CurrencyFormat class

This class contains the formatting settings for a currency.

Constructors

CurrencyFormat({required String symbol, String? code, SymbolSide symbolSide = SymbolSide.left, String? thousandSeparator, String? decimalSeparator, String symbolSeparator = ' '})
const

Properties

code String?
Abbreviation of the currency in lowercase. e.g. 'usd'
final
decimalSeparator String
Decimal separator. e.g. 9.10 ('.') or 9,10 (','). It can be set to any desired String. It defaults to '.' for SymbolSide.left and to ',' for SymbolSide.right.
no setter
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
symbol String
Symbol of the currency. e.g. '€'
final
symbolSeparator String
Character(s) between the number and the currency symbol. e.g. $ 9.10 (' ') or $9.10 (''). It defaults to a normal space (' ').
final
symbolSide SymbolSide
Whether the symbol is shown before or after the money value, or if it is not shown at all. e.g. $ 125 (SymbolSide.left) or 125 € (SymbolSide.right).
final
thousandSeparator String
Thousand separator. e.g. 1,000,000 (',') or 1.000.000 ('.'). It can be set to any desired String. It defaults to ',' for SymbolSide.left and to '.' for SymbolSide.right.
no setter

Methods

copyWith({String? code, String? symbol, SymbolSide? symbolSide, String? thousandSeparator, String? decimalSeparator, String? symbolSeparator}) CurrencyFormat
Returns the same CurrencyFormat but with some changed parameters.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Properties

local CurrencyFormat?
Get the CurrencyFormat of the local currency.
no setter
localSymbol String
Get the symbol of the local currency.
no setter

Static Methods

fromCode(String code, [List<CurrencyFormat> currencies = CurrencyFormatter.majorsList]) CurrencyFormat?
Get the CurrencyFormat of a currency using its abbreviation.
fromLocale([String? locale, List<CurrencyFormat> currencies = CurrencyFormatter.majorsList]) CurrencyFormat?
Get the CurrencyFormat of a currency using its locale.
fromSymbol(String symbol, [List<CurrencyFormat> currencies = CurrencyFormatter.majorsList]) CurrencyFormat?
Get the CurrencyFormat of a currency using its symbol.

Constants

chf → const CurrencyFormat
The CurrencyFormat of the Swiss Franc.
cny → const CurrencyFormat
The CurrencyFormat of the Chinese Yuan.
czk → const CurrencyFormat
The CurrencyFormat of the Czech Koruna.
eur → const CurrencyFormat
The CurrencyFormat of the Euro.
gbp → const CurrencyFormat
The CurrencyFormat of the British Pound.
huf → const CurrencyFormat
The CurrencyFormat of the Hungarian Forint.
idr → const CurrencyFormat
The CurrencyFormat of the Indonesian Rupiah.
ils → const CurrencyFormat
The CurrencyFormat of the Israeli New Shekel.
inr → const CurrencyFormat
The CurrencyFormat of the Indian Rupee.
jpy → const CurrencyFormat
The CurrencyFormat of the Japanese Yen.
krw → const CurrencyFormat
The CurrencyFormat of the South Korean Won.
myr → const CurrencyFormat
The CurrencyFormat of the Malaysian Ringgit.
php → const CurrencyFormat
The CurrencyFormat of the Philippine Peso.
pln → const CurrencyFormat
The CurrencyFormat of the Polish Zloty.
ron → const CurrencyFormat
The CurrencyFormat of the Romanian Leu.
rub → const CurrencyFormat
The CurrencyFormat of the Russian Ruble.
sek → const CurrencyFormat
The CurrencyFormat of the Swedish Krona.
thb → const CurrencyFormat
The CurrencyFormat of the Thai Baht.
tryx → const CurrencyFormat
The CurrencyFormat of the Turkish Lira.
usd → const CurrencyFormat
The CurrencyFormat of the US Dollar.
zar → const CurrencyFormat
The CurrencyFormat of the South African Rand.