Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. val format = NumberFormat.getCurrencyInstance(Locale.GERMANY) // getDefault()
  2. format.maximumFractionDigits = 2
  3. format.currency = Currency.getInstance("EUR")
  4. val result = format.format(2.8)
  5. println("result $result")
  6.  
  7. val curr = Currency.getInstance("EUR")
  8. val symbol = curr.getSymbol(Locale.GERMANY) // on device getDefault()
  9. println("Currency symbol is = $symbol")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement