formatGrouped

fun Long.formatGrouped(separator: Char = ','): String

Formats this value in decimal with separator between each group of three digits.

Grouping is fixed at three digits and is locale-independent, for example 1234567L.formatGrouped() is "1,234,567". Negative values keep a single leading minus sign, and Long.MIN_VALUE is handled without overflow.


fun Int.formatGrouped(separator: Char = ','): String

Formats this value in decimal with separator between each group of three digits.

Delegates to Long.formatGrouped; grouping is fixed at three digits and is locale-independent. Int.MIN_VALUE is handled without overflow.