number_format library

Provides locale-sensitive number formatting.

Use the NumberFormat class to format numbers in a locale-sensitive manner.

final numberFormat = NumberFormat(
  locale: Locale.parse('en'),
  roundingMode: RoundingMode.ceil,
  digits: const Digits.withFractionDigits(maximum: 1),
);
print(numberFormat.format(3.14)); // 3.2

Classes

CompactNotation
Compact notation, used for formatting large numbers in a shorter form (e.g., 1,000,000 as "1M").
CurrencyStyle
Formats a number as a currency.
DecimalStyle
Formats a number as a decimal.
Digits
EngineeringNotation
Engineering notation (e.g., 1.23e+006).
FormatStyle
Base class for different formatting styles.
FractionDigits
Control how many fraction digits to use in number formatting.
Locale
Representing a Unicode locale identifier.
Notation
Base class for different notation styles.
NumberFormat
Formats numbers according to locale-specific rules.
PercentStyle
Formats a number as a percentage.
ScientificNotation
Scientific notation (e.g., 1.23E6).
SignificantDigits
StandardNotation
Standard notation (e.g., 1,000,000).
UnitStyle
Formats a number with a unit.

Typedefs

UnitDisplay = Style