getCurrencyFormats method

CurrencyFormats getCurrencyFormats()

Return CurrencyFormats containing the format templates for formatting currencies in this locale.

The object has a number of properties in it that each are a particular style of format.

Implementation

CurrencyFormats getCurrencyFormats() {
  String result = '';

  final String jscode1 =
      'JSON.stringify(new LocaleInfo("$locale").getCurrencyFormats())';
  result = ILibJS.instance.evaluate(jscode1).stringResult;

  final Map<String, dynamic> map =
      json.decode(result) as Map<String, dynamic>;

  final CurrencyFormats cf = CurrencyFormats(
    common: (map['common'] as String?) ?? '',
    commonNegative: (map['commonNegative'] as String?) ?? '',
    iso: (map['iso'] as String?) ?? '',
    isoNegative: (map['isoNegative'] as String?) ?? '',
  );

  return cf;
}