unFormatCurrency static method

double unFormatCurrency(
  1. String amount, {
  2. String currency = 'id_IDR',
  3. dynamic symbol,
  4. dynamic decimalPattern = 'id_ID',
  5. dynamic digits = 2,
})

Implementation

static double unFormatCurrency(String amount, {String currency = 'id_IDR', symbol, decimalPattern = 'id_ID', digits = 2}) {
  final money = NumberFormat.currency(
    locale: defaultCurrency ?? currency,
    symbol: defaultCurrencySymbol ?? symbol,
    decimalDigits: defaultDecimalDigits ?? digits,
  );
  // money.parse(amount);
  return money.parse(amount).toDouble();
}