mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-09 23:22:16 -04:00
prevent non-terminating BigDecimal division
This commit is contained in:
parent
47f3d98597
commit
60341002fd
6 changed files with 12 additions and 13 deletions
|
@ -72,7 +72,6 @@ import javafx.collections.ObservableList;
|
|||
import javafx.collections.transformation.FilteredList;
|
||||
import javafx.collections.transformation.SortedList;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
|
@ -633,7 +632,7 @@ abstract class OfferBookViewModel extends ActivatableViewModel {
|
|||
}
|
||||
|
||||
public String formatDepositString(BigInteger deposit, long amount) {
|
||||
var percentage = FormattingUtils.formatToRoundedPercentWithSymbol(BigDecimal.valueOf(deposit.longValueExact()).divide(BigDecimal.valueOf(amount)).doubleValue());
|
||||
var percentage = FormattingUtils.formatToRoundedPercentWithSymbol(HavenoUtils.divide(deposit, BigInteger.valueOf(amount)));
|
||||
return HavenoUtils.formatXmr(deposit) + " (" + percentage + ")";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue