formatCurrency method

String formatCurrency({
  1. bool includeSymbol = true,
  2. bool includeCents = true,
})

Implementation

String formatCurrency({bool includeSymbol = true, bool includeCents = true}) {
  if (includeSymbol && includeCents) {
    return _kCurrencyFormatterSymbolWithCents.format(this);
  } else if (includeSymbol && !includeCents) {
    return _kCurrencyFormatterSymbolNoCents.format(this);
  } else if (!includeSymbol && includeCents) {
    return _kCurrencyFormatterNoSymbolWithCents.format(this);
  } else {
    return _kCurrencyFormatterNoSymbolNoCents.format(this);
  }
}