getCurrencySymbol function

String getCurrencySymbol({
  1. String? localeCode,
  2. String? currencyCode = 'USD',
})

Implementation

String getCurrencySymbol({String? localeCode, String? currencyCode = 'USD'}) {
  currencyCode ??= 'USD';

  final format = NumberFormat.simpleCurrency(
    name: currencyCode.toUpperCase(),
    locale: localeCode,
  );

  return format.currencySymbol;
}