compactCurrency method

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

format number with intl compactCurrency format

Implementation

String compactCurrency({
  String? locale,
  String? name,
  String? symbol,
  int? decimalDigits,
  String? customPattern,
}) {
  if (this == null) return '';
  return NumberFormat.compactCurrency(
    locale: locale,
    name: name,
    symbol: symbol,
    decimalDigits: decimalDigits,
  ).format(this!);
}