tokenInt static method
number transform 4: from
Implementation
static BigInt tokenInt(String? value, int decimals) {
if (value == null) {
return BigInt.zero;
}
double v = 0;
try {
if (value.contains(',') || value.contains('.')) {
v = NumberFormat(",##0.${"0" * decimals}").parse(value) as double;
} else {
v = double.parse(value);
}
} catch (err) {
print('Fmt.tokenInt() error: ${err.toString()}');
}
return BigInt.from(v * pow(10, decimals));
}