Skip to content
Snippets Groups Projects

Fix large integer queries

Merged Daniel Hornung requested to merge f-fix-145-large-integer into dev
All threads resolved!
Files
3
@@ -133,6 +133,8 @@ public class POV implements EntityFilterInterface {
this.vDouble = (double) this.vInt;
} else {
try {
// Doubles are allowed without dots, for example when the integer overflows.
// final Pattern dp = Pattern.compile("^(-?[0-9]+(?:\\.)?(?:[0-9]+))\\s*([^-]*)$");
final Pattern dp = Pattern.compile("^(-?[0-9]+(?:\\.[0-9]+))\\s*([^-]*)$");
final Matcher m = dp.matcher(value);
if (!m.matches()) {
@@ -142,9 +144,6 @@ public class POV implements EntityFilterInterface {
unitStr = m.group(2);
this.vDouble = Double.parseDouble(vDoubleStr);
if (this.vDouble % 1 == 0) {
this.vInt = (int) Math.floor(this.vDouble);
Please register or sign in to reply
}
} catch (final NumberFormatException e) {
this.vDouble = null;
}
@@ -505,6 +504,36 @@ public class POV implements EntityFilterInterface {
return ret;
}
/** Return the value type as string, for debugging puposes. */
public String getValueType() {
if (this.vInt != null) { // vInt
System.out.println(this.vInt);
return "Integer";
}
if (this.vDouble != null) { // vInt
return "Double";
}
if (this.vDatetime != null) { // vInt
return "Datetime";
}
return "String";
}
/** Return the Int value, which may be null. */
public Integer getVInt() {
return this.vInt;
}
/** Return the Double value, which may be null. */
public Double getVDouble() {
return this.vDouble;
}
/** Return the Datetime value, which may be null. */
public DateTimeInterface getVDatetime() {
return this.vDatetime;
}
public String getAggregate() {
return this.aggregate;
}
Loading