NumberFormatStyle

Types

Link copied to clipboard
data class Currency(val currencyCode: String? = null, val minIntegerDigits: UInt, val maxIntegerDigits: UInt, val minFractionDigits: UInt? = null, val maxFractionDigits: UInt? = null, val roundingMode: RoundingMode = RoundingMode.HalfEven) : NumberFormatStyle

Formats a number to a currency of a given currency code fitting its locale. Note: Some platforms may use different delimiters between the currency symbol and the number (if present for the locale). For instance, iOS often uses a non-breaking space, whereas Android uses a common space. This inconsistency is not corrected by this library and should thus be manually corrected if required.

Link copied to clipboard
data class Decimal(val minIntegerDigits: UInt, val maxIntegerDigits: UInt, val minFractionDigits: UInt, val maxFractionDigits: UInt, val roundingMode: RoundingMode = RoundingMode.HalfEven) : NumberFormatStyle

Formats a number to a decimal representation

Link copied to clipboard
data class Integer(val minDigits: UInt, val maxDigits: UInt, val roundingMode: RoundingMode = RoundingMode.HalfEven) : NumberFormatStyle

Formats a number to an integer representation

Link copied to clipboard
data class Pattern(val positivePattern: String, val negativePattern: String = "-", val roundingMode: RoundingMode = RoundingMode.HalfEven) : NumberFormatStyle

Formats a number to a pattern.

Link copied to clipboard
data class Percentage(val minIntegerDigits: UInt, val maxIntegerDigits: UInt, val minFractionDigits: UInt, val maxFractionDigits: UInt, val roundingMode: RoundingMode = RoundingMode.HalfEven) : NumberFormatStyle

Formats a number to a percentage value. 100% is represented by 1.0, so 0.8 will be formatted as 80%.

Link copied to clipboard
data class Permillage(val minIntegerDigits: UInt, val maxIntegerDigits: UInt, val minFractionDigits: UInt, val maxFractionDigits: UInt, val roundingMode: RoundingMode = RoundingMode.HalfEven) : NumberFormatStyle

Formats a number to a permillage value. 1000‰ is represented by 1.0, so 0.8 will be formatted as 800‰.

Link copied to clipboard
data class Scientific(val minIntegerDigits: UInt, val maxIntegerDigits: UInt = minIntegerDigits, val minFractionDigits: UInt, val maxFractionDigits: UInt, val minExponent: UInt, val roundingMode: RoundingMode = RoundingMode.HalfEven) : NumberFormatStyle

Formats a number to its scientific notation.

Properties

Link copied to clipboard