toCurrency method

String toCurrency({
  1. String symbol = '₹',
  2. String locale = AmountFormatter.defaultLocale,
  3. int decimalDigits = 0,
  4. String fallback = AmountFormatter.fallback,
})

Formats the number as currency.

Implementation

String toCurrency({
  String symbol = '₹',
  String locale = AmountFormatter.defaultLocale,
  int decimalDigits = 0,
  String fallback = AmountFormatter.fallback,
}) {
  return AmountFormatter.format(
    this,
    symbol: symbol,
    decimalDigits: decimalDigits,
    locale: locale,
    fallbackValue: fallback,
  );
}