NumberFormat.currencyPattern constructor

  1. @Deprecated("Use NumberFormat.currency")
NumberFormat.currencyPattern([String locale, String currencyNameOrSymbol ])

Create a number format that prints as CURRENCY_PATTERN. (Deprecated: prefer NumberFormat.currency)

If provided, use nameOrSymbol in place of the default currency name. e.g. var eurosInCurrentLocale = new NumberFormat .currencyPattern(Intl.defaultLocale, "€");

Implementation

@Deprecated("Use NumberFormat.currency")
factory NumberFormat.currencyPattern(
    [String locale, String currencyNameOrSymbol]) {
  // If it looks like an iso4217 name, pass as name, otherwise as symbol.
  if (currencyNameOrSymbol != null &&
      _checkCurrencyName.hasMatch(currencyNameOrSymbol)) {
    return new NumberFormat.currency(
        locale: locale, name: currencyNameOrSymbol);
  } else {
    return new NumberFormat.currency(
        locale: locale, symbol: currencyNameOrSymbol);
  }
}