mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-23 06:14:11 -04:00
fix divide by zero error opening trade summary with no history
This commit is contained in:
parent
285335d138
commit
a92b4b8d0f
1 changed files with 2 additions and 2 deletions
|
@ -76,7 +76,7 @@ public class ClosedTradableFormatter {
|
|||
}
|
||||
|
||||
public String getTotalTxFeeAsString(BigInteger totalTradeAmount, BigInteger totalTxFee) {
|
||||
double percentage = HavenoUtils.divide(totalTxFee, totalTradeAmount);
|
||||
double percentage = totalTradeAmount.equals(BigInteger.ZERO) ? 0 : HavenoUtils.divide(totalTxFee, totalTradeAmount);
|
||||
return Res.get(I18N_KEY_TOTAL_TX_FEE,
|
||||
HavenoUtils.formatXmr(totalTxFee, true),
|
||||
formatToPercentWithSymbol(percentage));
|
||||
|
@ -104,7 +104,7 @@ public class ClosedTradableFormatter {
|
|||
}
|
||||
|
||||
public String getTotalTradeFeeAsString(BigInteger totalTradeAmount, BigInteger totalTradeFee) {
|
||||
double percentage = HavenoUtils.divide(totalTradeFee, totalTradeAmount);
|
||||
double percentage = totalTradeAmount.equals(BigInteger.ZERO) ? 0 : HavenoUtils.divide(totalTradeFee, totalTradeAmount);
|
||||
return Res.get(I18N_KEY_TOTAL_TRADE_FEE_BTC,
|
||||
HavenoUtils.formatXmr(totalTradeFee, true),
|
||||
formatToPercentWithSymbol(percentage));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue