toCurrencyCompact method

String toCurrencyCompact({
  1. bool? withSymbol,
  2. string? locale,
})

Num to locale compact currency with symbol or not

Implementation

String toCurrencyCompact({bool? withSymbol, string? locale}) {
  locale ??= platformLocaleCode;
  if (withSymbol == false) {
    return NumberFormat.compactSimpleCurrency(name: '', locale: locale).format(this).trim();
  } else {
    return NumberFormat.compactSimpleCurrency(locale: locale).format(this).trim();
  }
}