mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-23 04:29:22 +00:00
log error on infinity in offer book chart view without popup #1340
This commit is contained in:
parent
bc1cfe3ba0
commit
123a2a8487
1 changed files with 13 additions and 8 deletions
|
@ -207,6 +207,7 @@ public class OfferBookChartView extends ActivatableViewAndModel<VBox, OfferBookC
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString(Number object) {
|
public String toString(Number object) {
|
||||||
|
try {
|
||||||
final double doubleValue = (double) object;
|
final double doubleValue = (double) object;
|
||||||
if (CurrencyUtil.isCryptoCurrency(model.getCurrencyCode())) {
|
if (CurrencyUtil.isCryptoCurrency(model.getCurrencyCode())) {
|
||||||
final String withCryptoPrecision = FormattingUtils.formatRoundedDoubleWithPrecision(doubleValue, cryptoPrecision);
|
final String withCryptoPrecision = FormattingUtils.formatRoundedDoubleWithPrecision(doubleValue, cryptoPrecision);
|
||||||
|
@ -218,6 +219,10 @@ public class OfferBookChartView extends ActivatableViewAndModel<VBox, OfferBookC
|
||||||
} else {
|
} else {
|
||||||
return df.format(Double.parseDouble(FormattingUtils.formatRoundedDoubleWithPrecision(doubleValue, 0)));
|
return df.format(Double.parseDouble(FormattingUtils.formatRoundedDoubleWithPrecision(doubleValue, 0)));
|
||||||
}
|
}
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
log.error("Error converting number to string, tradeCurrency={}, number={}\n", code, object, e);
|
||||||
|
return "NaN"; // TODO: occasionally getting invalid number
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue