I am developing a custom currency field with lightning:input type="number" formatter="currency" component:
<lightning:input type="number" formatter="currency" value="100" step="1"/>
I have enabled in my org the Multiple Currencies
feature so each record's amounts can be declared with different currencies
This means that sometimes my custom field will contain USD numbers and sometimes ILS (Israeli currency). and the symbol near the number value needs to change accordingly.
On the view mode of my component, I am using this:
<lightning:formattedNumber style="currency" currencyCode="{!v.record.CurrencyIsoCode}" currencyDisplayAs="symbol" value="100"/>
and it works perfect!
PROBLEM
In the lightning:input
component the currency symbol is displayed according to the user's local currency and not according to the record's defined currency.
for example - this is how a field looks like when it's record is defined as USD, but it displays in ILS:
QUESTION
Is there a way to define the lightning:input
component to change the currency symbol?
If not - what is the best approach to show the right symbol (I have the CurrencyIsoCode
field in my code and can use it)