mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-31 20:11:23 +00:00
Same change for Fiat.parseCoin
This commit is contained in:
@@ -81,8 +81,13 @@ public final class Fiat implements Monetary, Comparable<Fiat>, Serializable {
|
||||
* if you try to specify fractional satoshis, or a value out of range.
|
||||
*/
|
||||
public static Fiat parseFiat(final String currencyCode, final String str) {
|
||||
return Fiat.valueOf(currencyCode, new BigDecimal(str).movePointRight(SMALLEST_UNIT_EXPONENT)
|
||||
.toBigIntegerExact().longValue());
|
||||
try {
|
||||
long val = new BigDecimal(str).movePointRight(SMALLEST_UNIT_EXPONENT)
|
||||
.toBigIntegerExact().longValue();
|
||||
return Fiat.valueOf(currencyCode, val);
|
||||
} catch (ArithmeticException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Fiat add(final Fiat value) {
|
||||
|
Reference in New Issue
Block a user