mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Format fiat currency tick mark label on Y-axis.
Format currency tick values as integers for a more compact form, without the 4-zeroesfractional part.
This commit is contained in:
parent
9034c780c9
commit
1ab7e26fd1
1 changed files with 5 additions and 1 deletions
|
@ -89,6 +89,8 @@ import javafx.collections.transformation.SortedList;
|
|||
import javafx.util.Callback;
|
||||
import javafx.util.StringConverter;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
@ -349,11 +351,13 @@ public class TradesChartsView extends ActivatableViewAndModel<VBox, TradesCharts
|
|||
public String toString(Number object) {
|
||||
String currencyCode = model.getCurrencyCode();
|
||||
double doubleValue = (double) object;
|
||||
|
||||
if (CurrencyUtil.isCryptoCurrency(currencyCode)) {
|
||||
final double value = MathUtils.scaleDownByPowerOf10(doubleValue, 8);
|
||||
return FormattingUtils.formatRoundedDoubleWithPrecision(value, 8);
|
||||
} else {
|
||||
return FormattingUtils.formatPrice(Price.valueOf(currencyCode, MathUtils.doubleToLong(doubleValue)));
|
||||
DecimalFormat df = new DecimalFormat(",###");
|
||||
return df.format(Double.parseDouble(FormattingUtils.formatPrice(Price.valueOf(currencyCode, MathUtils.doubleToLong(doubleValue)))));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue