Skip to content

Commit

Permalink
Merge pull request #924 from spelletier/Fix_ERXNumberFormaterBugWithZero
Browse files Browse the repository at this point in the history
Fix an ERXNumberFormater problem with zero and patterns like 0.00000000
  • Loading branch information
darkv authored Feb 16, 2020
2 parents 9219d92 + e51817b commit 47f4782
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ public Object parseObject(String aString) throws java.text.ParseException {
}
String filteredString = new String(filteredChars, 0, count);
Object result = super.parseObject(filteredString);
if (result instanceof BigDecimal && ((BigDecimal) result).signum() == 0) {
result = BigDecimal.ZERO;
}
if(result instanceof Number && _operator != null) {
BigDecimal newValue = null;
if(result instanceof BigDecimal) {
Expand Down

0 comments on commit 47f4782

Please sign in to comment.