chooseRightOrderOnCurrencySymbol static method

String chooseRightOrderOnCurrencySymbol(
  1. dynamic amount,
  2. String currencyCode, {
  3. NumberFormat? priceFormat,
  4. String? locale,
})

returns a formatted acount with currency code with given priceFormat

Implementation

static String chooseRightOrderOnCurrencySymbol(
  dynamic amount,
  String currencyCode, {
  NumberFormat? priceFormat,
  String? locale,
}) {
  // Fall back to the ISO code when the symbol is unknown. Interpolating the
  // lookup directly rendered the literal string "null" as the symbol for any
  // currency missing from the map.
  final symbol = _simpleCurrencySymbols[currencyCode] ?? currencyCode;
  return NumberFormat.currency(
    name: currencyCode,
    symbol: symbol,
    locale: locale,
  ).format(amountFromJson(amount));
}