toCurrency

inline fun <T : Number> T?.toCurrency(locale: Locale = Locale.getDefault()): String

Formats this number as currency and returns the result as a string.

This number is interpreted as a decimal value, and the resulting string is formatted according to the locale's default currency. If this number is null, the result is an empty string.

Return

the formatted string.

Parameters

locale

the locale to which the currency should be formatted.