toPrice

fun Double.toPrice(symbol: String = "$", decimals: Int = 2, thousandsSep: String = ",", decimalSep: String = ".", symbolAfter: Boolean = false): String(source)

Formats a Double as a price string with a currency symbol. Example: 19.99.toPrice() → "$19.99" Example: 1234.5.toPrice("€", thousandsSep = ".") → "€1.234,50"