mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-01-22 02:34:57 +00:00
use fixed localization for parsing offer amounts
This commit is contained in:
parent
39bc54df73
commit
66770cc98f
1 changed files with 3 additions and 1 deletions
|
@ -31,6 +31,8 @@ import java.math.BigDecimal;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
import java.text.DecimalFormatSymbols;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkArgument;
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
import static haveno.core.util.VolumeUtil.getAdjustedVolumeUnit;
|
import static haveno.core.util.VolumeUtil.getAdjustedVolumeUnit;
|
||||||
|
@ -104,7 +106,7 @@ public class CoinUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BigInteger getRoundedAmount4Decimals(BigInteger amount, Long maxTradeLimit) {
|
public static BigInteger getRoundedAmount4Decimals(BigInteger amount, Long maxTradeLimit) {
|
||||||
DecimalFormat decimalFormat = new DecimalFormat("#.####");
|
DecimalFormat decimalFormat = new DecimalFormat("#.####", HavenoUtils.DECIMAL_FORMAT_SYMBOLS);
|
||||||
double roundedXmrAmount = Double.parseDouble(decimalFormat.format(HavenoUtils.atomicUnitsToXmr(amount)));
|
double roundedXmrAmount = Double.parseDouble(decimalFormat.format(HavenoUtils.atomicUnitsToXmr(amount)));
|
||||||
return HavenoUtils.xmrToAtomicUnits(roundedXmrAmount);
|
return HavenoUtils.xmrToAtomicUnits(roundedXmrAmount);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue