Symbols

A number of currency have different symbols, you can specify the symbol when creating the currency.

The Common Currencies have the appropriate symbol configured for each currency.

void main() {
   test('Symbols', () {
      // Create a currency for Japan's yen with the correct symbol
      final jpy = Currency.create('JPY', 0, symbol: '¥');
      expect(jpy.symbol, equals('¥'));
      final euro = Currency.create('EUR', 2, symbol: '€');
      expect(euro.symbol, equals('€'));
    });
}

Last updated

Was this helpful?