Skip to content

Commit

Permalink
Change check to prec. 3 for making decision to display precision 8 or 4
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer committed Sep 4, 2016
1 parent 75b269c commit 84a55d9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ protected void activate() {
public String toString(Number object) {
final double doubleValue = (double) object;
if (CurrencyUtil.isCryptoCurrency(model.getCurrencyCode())) {
final String withPrecision4 = formatter.formatRoundedDoubleWithPrecision(doubleValue, 4);
if (withPrecision4.equals("0.0000"))
final String withPrecision3 = formatter.formatRoundedDoubleWithPrecision(doubleValue, 3);
if (withPrecision3.equals("0.000"))
return formatter.formatRoundedDoubleWithPrecision(doubleValue, 8);
else
return withPrecision4;
return withPrecision3;
} else {
return formatter.formatRoundedDoubleWithPrecision(doubleValue, 2);
}
Expand Down

0 comments on commit 84a55d9

Please sign in to comment.