mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-04-16 13:27:28 -04:00
Fix parsing big numbers
This commit is contained in:
@@ -117,6 +117,9 @@ public class Utils {
|
||||
NumberFormat numberInputFormat = NumberFormat.getNumberInstance();
|
||||
NumberFormat numberToBigDecimalFormat = NumberFormat.getNumberInstance(Locale.US);
|
||||
|
||||
// BigDecimal won't understand values like 1,000 instead of 1000
|
||||
numberToBigDecimalFormat.setGroupingUsed(false);
|
||||
|
||||
return new BigDecimal(numberToBigDecimalFormat.format(numberInputFormat.parse(value)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user