DHUNumberFormatExtensions extension

Extension methods for the num type to format numbers using the intl package.

on

Methods

formatAsCompact({String? locale}) String

Available on num, provided by the DHUNumberFormatExtensions extension

Formats the number in a compact form with the given locale.
formatAsCompactCurrency({String? locale, String? name, int? decimalDigits}) String

Available on num, provided by the DHUNumberFormatExtensions extension

Formats the number as compact simple currency with the given locale and name.
formatAsCompactLong({String? locale, bool explicitSign = false}) String

Available on num, provided by the DHUNumberFormatExtensions extension

Formats the number in a long compact form with the given locale.
formatAsCurrency({String? locale, String symbol = r'$', int decimalDigits = 2, String? customPattern}) String

Available on num, provided by the DHUNumberFormatExtensions extension

Formats the number as currency with the given locale, symbol, and decimalDigits.
formatAsDecimal({String? locale}) String

Available on num, provided by the DHUNumberFormatExtensions extension

Formats the number as a decimal with the given locale and decimalDigits.
formatAsDecimalPercent({String? locale, int? decimalDigits}) String

Available on num, provided by the DHUNumberFormatExtensions extension

Formats the number as a decimal percentage with the given locale and decimalDigits.
formatAsPercentage({String? locale}) String

Available on num, provided by the DHUNumberFormatExtensions extension

Formats the number as a percentage with the given locale.
formatAsReadableNumber({String? locale, int decimalDigits = 2, String? groupingSeparator, String? decimalSeparator, bool trimTrailingZeros = false}) String

Available on num, provided by the DHUNumberFormatExtensions extension

Formats this number into a readable string with customizable options.
formatAsScientific({String? locale}) String

Available on num, provided by the DHUNumberFormatExtensions extension

Formats the number as a scientific value with the given locale.
formatAsSimpleCurrency({String? locale, String? name, int? decimalDigits}) String

Available on num, provided by the DHUNumberFormatExtensions extension

Formats the number as simple currency with the given locale and name.
formatWithCustomPattern(String pattern, {String? locale}) String

Available on num, provided by the DHUNumberFormatExtensions extension

Formats the number using a custom pattern with the given locale.