Find a currency
To find a Currency that either belongs to one of the Common Currencies or one that you have registered you can use the Currencies().find
method.
test('Find a currency', () {
// Find a registered currency via its code.
final audCurrency = Currencies().find('AUD');
final audCostPrice = Money.fromIntWithCurrency(899, audCurrency!);
expect(audCostPrice.currency.isoCode, equals('AUD'));
});
The Money parser is also able to automatically find a currency if the currency code is a Common Currency or one you have registered.
Last updated
Was this helpful?