formatNumber

abstract fun formatNumber(value: Double, decimals: Int?, grouping: Boolean): String

value as a decimal string.

decimals fixes both the minimum and the maximum number of fraction digits when present; when absent the formatter chooses. grouping asks for the locale's group separators.