Skip to content
Snippets Groups Projects
Commit 6124528e authored by uhensler's avatar uhensler
Browse files

OO-4407: Fix broken unit tests

parent cee3a5f7
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,7 @@ public class CalculatedLong { ...@@ -44,7 +44,7 @@ public class CalculatedLong {
} }
public CalculatedLong(String identifier, BigDecimal subIdentifier, long value) { public CalculatedLong(String identifier, BigDecimal subIdentifier, long value) {
this(identifier, subIdentifier.toPlainString(), value); this(identifier, trimZerosFromEnd(subIdentifier.toPlainString()), value);
} }
public CalculatedLong(String identifier, String subIdentifier, long value) { public CalculatedLong(String identifier, String subIdentifier, long value) {
...@@ -65,5 +65,14 @@ public class CalculatedLong { ...@@ -65,5 +65,14 @@ public class CalculatedLong {
public long getValue() { public long getValue() {
return value; return value;
} }
private static String trimZerosFromEnd(String value) {
int len = value.length();
int st = 0;
while ((st < len) && (value.charAt(len - 1) == '0' || value.charAt(len - 1) == '.')) {
len--;
}
return value.substring(0, len);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment