“Format waluty Kotlin” Kod odpowiedzi

Format waluty Kotlin

val numberFormat = NumberFormat.getCurrencyInstance()  
numberFormat.setMaximumFractionDigits(0);
val convert = numberFormat.format(1000000)
    
println(convert)

// result: $1,000,000
Apollo

Format waluty Kotlin


val locale = Locale.getDefault()
val numberFormat = NumberFormat.getCurrencyInstance(locale)
println(numberFormat.currency)  // on my device in Italy prints: EUR
    
val symbol = numberFormat.currency?.symbol
println(symbol) // on my device in Italy prints: € 



var pound = Currency.getInstance("GBP");
val symbol = pound.symbol
println(symbol) // prints £
simone mapelli

Odpowiedzi podobne do “Format waluty Kotlin”

Pytania podobne do “Format waluty Kotlin”

Więcej pokrewnych odpowiedzi na “Format waluty Kotlin” w Kotlin

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu