formatAsCurrency method

String formatAsCurrency({
  1. String? locale,
  2. String symbol = r'$',
  3. int decimalDigits = 2,
  4. String? customPattern,
})

Formats the number as currency with the given locale, symbol, and decimalDigits.

Implementation

String formatAsCurrency({
  String? locale,
  String symbol = r'$',
  int decimalDigits = 2,
  String? customPattern,
}) {
  return NumberFormat.currency(
    locale: locale,
    symbol: symbol,
    decimalDigits: decimalDigits,
    customPattern: customPattern,
  ).format(this);
}