3

I am using multiple currencies in my project and I have the currency ISO code. But the problem is, I want to get the symbol for currencies other than user locale. Is there any solution available for this? Example :

in Lighting JS $A.get('$locale.currency') will return the user locale currency. I want to get the symbol for other currencies which are available in my org, Like Euro, Yen, etc.

2
  • 1
    At what point of time would you want to get the other currencies displayed? Like how do you choose if USD vs. Euro vs. Yen should be displayed? – Jayant Das Sep 24 '18 at 17:46
  • I want to show it on the chart. In which I am passing the CurrencyISOCode. – Tarique Shamim Oct 20 '18 at 17:02
0

lightning:formattedNumber allows you to pass a currency code dynamically and will render the appropriate symbol. All you need to do is in the init method set the currencyCode attribute to the current users iso code

example:

<lightning:formattedNumber value="10.00" style="currency" currencyCode="{!v.currencyCode}"/>

will render as $10.00 if the users ISO code is USD

Heres a link to the documentation

1
  • I know to use this one in lightning. But if I am using it on a chart which is created using using the chartJS library, then I need to show it on the charts. So, I will need some method which returns currencyISOSymbol for the code, so that I can set it on the chart. – Tarique Shamim Oct 20 '18 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.