number library

Functions

formatCurrency({num? value, String? locale = 'en_US', String symbol = 'USD', int? minimumFractionDigits, int? maximumFractionDigits}) String
Formats a value as a currency string using the given localeand symbol. minimumFractionDigits and maximumFractionDigits can be used to specify the minimum and maximum number of decimal places to display.
formatDecimal({num? value, String? locale = 'en_US', String? pattern = "#,##0.##", int? minimumFractionDigits, int? maximumFractionDigits}) String
Formats a value as a decimal string using the given locale and pattern. minimumFractionDigits and maximumFractionDigits can be used to specify the minimum and maximum number of decimal places to display.
formatPercentage({num? value, String? locale = 'en_US', String? pattern = "#,##0.##", int? minimumFractionDigits, int? maximumFractionDigits}) String
Formats a value as a percentage string using the given locale and pattern. minimumFractionDigits and maximumFractionDigits can be used to specify the minimum and maximum number of decimal places to display.
getCurrencyNumberFormat({num? value, String? locale = 'en_US', String symbol = 'USD', int? minimumFractionDigits, int? maximumFractionDigits}) → NumberFormat
Returns a NumberFormat for currency that uses the locale, symbol, and specific fraction digits defined by the user.
getDecimalNumberFormat({num? value, String? locale = 'en_US', String? pattern = "#,##0.##", int? minimumFractionDigits, int? maximumFractionDigits}) → NumberFormat
Returns a NumberFormat for decimal numbers that uses the locale, pattern, and specific fraction digits defined by the user.
getDefaultFractionDigits(num? value, int? minimumFractionDigits, int? maximumFractionDigits) → (int, int)
Retrieves the default minimum and maximum fraction digits based on the provided value.
isCharDigit(String char) bool
Returns true if char represents a digit, false otherwise.
isCharDigitOrDecimalPoint(String char) bool
Returns true if char represents a digit or a decimal point, false otherwise.
isDoubleInteger(double number, {int? epsilonExponent}) bool
Checks if the input number is a "double integer", i.e., a double value that represents an integer value. Returns true if the input number is a double integer, false otherwise.
isNumberInteger(num number, {int? epsilonExponent}) bool
Checks if the input number is an integer. Returns true if the input number is an integer, false otherwise.
isStringNumber(String str) bool
Returns true if str represents a valid number, false otherwise.
isStringPercentage(String str) bool
Returns true if the given str is a string representation of a percentage, false otherwise.
scientificNotationValue(int exponent) double