All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.formatter.NumberFormatterBuilders.kt Maven / Gradle / Ivy

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