mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Use same precision for all x-axis labels
This commit is contained in:
parent
f36823f145
commit
7f00fe227f
@ -214,15 +214,18 @@ public class OfferBookChartView extends ActivatableViewAndModel<VBox, OfferBookC
|
||||
String code = tradeCurrency.getCode();
|
||||
volumeColumnLabel.set(Res.get("shared.amountWithCur", code));
|
||||
xAxis.setTickLabelFormatter(new StringConverter<>() {
|
||||
int precision3 = 3;
|
||||
@Override
|
||||
public String toString(Number object) {
|
||||
final double doubleValue = (double) object;
|
||||
if (CurrencyUtil.isCryptoCurrency(model.getCurrencyCode())) {
|
||||
final String withPrecision3 = formatter.formatRoundedDoubleWithPrecision(doubleValue, 3);
|
||||
if (withPrecision3.equals("0.000"))
|
||||
return formatter.formatRoundedDoubleWithPrecision(doubleValue, 8);
|
||||
else
|
||||
final String withPrecision3 = formatter.formatRoundedDoubleWithPrecision(doubleValue, precision3);
|
||||
if (withPrecision3.equals("0.000")) {
|
||||
precision3 = 8;
|
||||
return formatter.formatRoundedDoubleWithPrecision(doubleValue, precision3);
|
||||
} else {
|
||||
return withPrecision3;
|
||||
}
|
||||
} else {
|
||||
return formatter.formatRoundedDoubleWithPrecision(doubleValue, 2);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user