Android Question Currency symbol.

peter93

Member
Licensed User
Longtime User
I would like to retrieve the symbol of the currency being used on the device (by default?)
I found a java class that is 'java.util.Currency' with a method called 'String getSymbol()'. but not knowing Java, I can't write the function correctly for B4A. Could someone help me?
 

DonManfred

Expert
Licensed User
Longtime User
Try this library.
Samplecode
B4X:
    Dim chlp As CurrencyHelper
    chlp.Initialize("GBP")
    Log($"${chlp.DisplayName}"$)
    Log($"${chlp.Symbol}"$)
Output
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Britisches Pfund
£
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
Note that i am german and i get the german version of the Displayname
 

Attachments

  • CurrencyHelperV0.01.zip
    1.4 KB · Views: 151
Upvote 0
Top