formatDecimalLocalized

expect fun formatDecimalLocalized(value: Double, fractionDigits: Int): String(source)

Formats value to fractionDigits decimal places using the OS locale's decimal and grouping separators.

This is what every user-facing number goes through, so a German reader sees "3,85" and "1.024" where an American sees "3.85" and "1,024". Anything that will be re-parsed or handed to another system must use NumberFormatter.formatInvariant instead.

actual fun formatDecimalLocalized(value: Double, fractionDigits: Int): String(source)

Android and the desktop JVM share this: both resolve separators and grouping from the platform locale data.

Rounds half-up rather than the JDK default of half-even, so moving a displayed telemetry value onto locale formatting changes its separators and nothing else.