Dani
Dani

Reputation: 4177

Flutter: how to get currency symbol from currency code

From language code it's easy:

var format = NumberFormat.simpleCurrency(locale: "es");
print(format.currencySymbol);

But the only thing I have is EUR for euro, so the currency code

Upvotes: 7

Views: 2459

Answers (2)

Dani
Dani

Reputation: 4177

var format = NumberFormat.simpleCurrency(locale: _language); // doesn't really matter what language you pass
print(format.simpleCurrencySymbol("EUR"));

Upvotes: 4

Boris Karabanov
Boris Karabanov

Reputation: 11

Try this:

NumberFormat().simpleCurrencySymbol('USF') // $

https://api.flutter.dev/flutter/intl/NumberFormat/simpleCurrencySymbol.html

Upvotes: 1

Related Questions