Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use fixed localization for parsing offer amounts #1555

Merged
merged 1 commit into from
Jan 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/src/main/java/haveno/core/util/coin/CoinUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;

import static com.google.common.base.Preconditions.checkArgument;
import static haveno.core.util.VolumeUtil.getAdjustedVolumeUnit;
Expand Down Expand Up @@ -104,7 +106,7 @@ public static BigInteger getRoundedAmountUnit(BigInteger amount, Price price, Lo
}

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)));
return HavenoUtils.xmrToAtomicUnits(roundedXmrAmount);
}
Expand Down
Loading