NumberFormat.compactCurrency constructor

NumberFormat.compactCurrency({
  1. String? locale,
  2. String? name,
  3. String? symbol,
  4. int? decimalDigits,
})

A number format for compact currency representations, e.g. "$1.2M" instead of "$1,200,000".

Implementation

factory NumberFormat.compactCurrency(
    {String? locale, String? name, String? symbol, int? decimalDigits}) {
  return _CompactNumberFormat(
      locale: locale,
      formatType: _CompactFormatType.COMPACT_DECIMAL_SHORT_CURRENCY_PATTERN,
      name: name,
      getPattern: (symbols) => symbols.CURRENCY_PATTERN,
      currencySymbol: symbol,
      decimalDigits: decimalDigits,
      isForCurrency: true);
}