Increase price precision in Offer Book chart (altcoins)

In the Offer Book Chart, altcoins were displayed with prices
having only 3 decimal places of precision.  This resulted in
not being able to see any meaningful prices across the
x-axis because they were all the same, e.g. ETH=0.025
Instead it should show 8 digits of precision for altcoins.
So for example ETH=0.02456914
Change the rule from if price begins 0.000 then display
higher precision, to if price begins 0.0 then display higher
precision.

Fixes #4251
This commit is contained in:
jmacxx 2020-06-15 21:59:21 -05:00
parent 04872e03ee
commit 37331cde31
No known key found for this signature in database
GPG key ID: 155297BABFE94A1B

View file

@ -226,7 +226,7 @@ public class OfferBookChartView extends ActivatableViewAndModel<VBox, OfferBookC
final double doubleValue = (double) object;
if (CurrencyUtil.isCryptoCurrency(model.getCurrencyCode())) {
final String withCryptoPrecision = FormattingUtils.formatRoundedDoubleWithPrecision(doubleValue, cryptoPrecision);
if (withCryptoPrecision.equals("0.000")) {
if (withCryptoPrecision.substring(0,3).equals("0.0")) {
cryptoPrecision = 8;
return FormattingUtils.formatRoundedDoubleWithPrecision(doubleValue, cryptoPrecision);
} else {