commonMain.formatter.NumberFormatterBuilders.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of formatter Show documentation
Show all versions of formatter Show documentation
A platform agnostic way of formatting data
The newest version!
package formatter
fun NumberFormatter(
abbreviate: Boolean = NumberFormatterOptions.DEFAULT_ABBREVIATE,
prefix: String = NumberFormatterOptions.DEFAULT_PREFIX,
postfix: String = NumberFormatterOptions.DEFAULT_POSTFIX,
decimals: Int? = null,
enforceDecimals: Boolean = NumberFormatterOptions.DEFAULT_ENFORCE_DECIMALS,
decimalSeparator: String = NumberFormatterOptions.DEFAULT_DECIMAL_SEPARATOR,
thousandsSeparator: String = NumberFormatterOptions.DEFAULT_THOUSAND_SEPERATOR
) = NumberFormatter(
NumberFormatterOptions(
abbreviate,
prefix,
postfix,
decimals = decimals ?: if (abbreviate) NumberFormatterOptions.DEFAULT_DECIMALS_ABBREVIATED else NumberFormatterOptions.DEFAULT_DECIMALS_UNABBREVIATED,
enforceDecimals,
decimalSeparator,
thousandsSeparator
)
)
© 2015 - 2024 Weber Informatics LLC | Privacy Policy