You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cake_wallet/cw_wownero/lib/wownero_amount_format.dart

19 lines
680 B

import 'package:intl/intl.dart';
import 'package:cw_core/crypto_amount_format.dart';
const wowneroAmountLength = 11;
const wowneroAmountDivider = 100000000000;
final wowneroAmountFormat = NumberFormat()
..maximumFractionDigits = wowneroAmountLength
..minimumFractionDigits = 1;
String wowneroAmountToString({int amount}) => wowneroAmountFormat
.format(cryptoAmountToDouble(amount: amount, divider: wowneroAmountDivider))
.replaceAll(',', '');
double wowneroAmountToDouble({int amount}) =>
cryptoAmountToDouble(amount: amount, divider: wowneroAmountDivider);
int wowneroParseAmount({String amount}) =>
(double.parse(amount) * wowneroAmountDivider).toInt();