decimalDigits property Null safety

int? decimalDigits

The number of decimal places to use when formatting.

If this is not explicitly specified in the constructor, then for currencies we use the default value for the currency if the name is given, otherwise we use the value from the pattern for the locale.

So, for example, NumberFormat.currency(name: 'USD', decimalDigits: 7) will format with 7 decimal digits, because that's what we asked for. But NumberFormat.currency(locale: 'en_US', name: 'JPY') will format with zero, because that's the default for JPY, and the currency's default takes priority over the locale's default. NumberFormat.currency(locale: 'en_US') will format with two, which is the default for that locale.


final int? decimalDigits;