mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-03 20:24:24 -04:00
parse commas in xmr amounts to decimal
This commit is contained in:
parent
4217424c6e
commit
0294062312
2 changed files with 3 additions and 2 deletions
|
@ -34,6 +34,7 @@ import haveno.core.trade.messages.InitTradeRequest;
|
|||
import haveno.core.trade.messages.PaymentReceivedMessage;
|
||||
import haveno.core.trade.messages.PaymentSentMessage;
|
||||
import haveno.core.util.JsonUtil;
|
||||
import haveno.core.util.ParsingUtils;
|
||||
import haveno.network.p2p.NodeAddress;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
|
@ -189,7 +190,7 @@ public class HavenoUtils {
|
|||
public static BigInteger parseXmr(String input) {
|
||||
if (input == null || input.length() == 0) return BigInteger.valueOf(0);
|
||||
try {
|
||||
return xmrToAtomicUnits(new BigDecimal(input).doubleValue());
|
||||
return xmrToAtomicUnits(new BigDecimal(ParsingUtils.parseNumberStringToDouble(input)).doubleValue());
|
||||
} catch (Exception e) {
|
||||
return BigInteger.valueOf(0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue