toCurrency method

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

Num to locale currency with symbol or not

Implementation

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