mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Merge pull request #4761 from deusmax/trading_charts_axisY
Apply format to trading charts axis Y values
This commit is contained in:
commit
f6a2f3d6e1
1 changed files with 6 additions and 2 deletions
|
@ -95,6 +95,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;
|
||||
|
@ -442,11 +444,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);
|
||||
return FormattingUtils.formatRoundedDoubleWithPrecision(value, 8).replaceFirst("0{3}$", "");
|
||||
} 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