Issue
Is there a simple way for the system to return the local currency symbol?
I been searching but I cant find anything, in swift you can achieve this with two lines:
let locale = Locale.current
let currencySymbol = locale.currencySymbol!
¿Is there anything similar in Kotlin?
Solution
you can try:
val numberFormat = NumberFormat.getCurrencyInstance(Locale.getDefault())
val symbol = numberFormat.currency?.symbol
// symbol = £
Answered By - You Qi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.