Skip to content

Commit

Permalink
Use toPlainString() to prevent scientific notation
Browse files Browse the repository at this point in the history
  • Loading branch information
zefir-git committed Jul 21, 2023
1 parent 84cfd56 commit b7f80d6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public static String formatCurrencyShort(BigDecimal amount) {
String suffix = bounds.get(bound);
BigDecimal divided = absAmount.divide(bound, RoundingMode.HALF_UP);
int scale = divided.compareTo(BigDecimal.valueOf(10)) < 0 ? 2 : divided.compareTo(BigDecimal.valueOf(100)) < 0 ? 1 : 0;
return prefix + divided.setScale(scale, RoundingMode.HALF_UP).stripTrailingZeros() + suffix;
return prefix + divided.setScale(scale, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString() + suffix;
}

/**
Expand Down

0 comments on commit b7f80d6

Please sign in to comment.