toCurrencyCompact method

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

Num to locale compact currency with symbol or not

Implementation

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