normalizeCurrency property

String get normalizeCurrency

Normalizes currency symbol (e.g NGN -> ₦, USD -> $)

Example:

final text = 'USD';
final normalized = text.normalizeCurrency;
// returns: '$'

Implementation

String get normalizeCurrency => switch (toUpperCase()) {
  'NGN' || '₦' => r'₦',
  'USD' || '\$' => r'$',
  'EUR' || '€' => r'€',
  'GBP' || '£' => r'£',
  _ => this,
};