I'm using LWC, but I can't set custom currency in the lightning-input, using type number or currency.
I also try to use lightning-input-field of type currency, but I found in documentation:
Displays an input field for entering monetary data. The user’s
Salesforce locale determines the currency symbol and separator
characters used to format the number. Specifying a different locale is
currently not supported for currency.
We have users with, for example, local with USD but they can create Quotes in different currencies.
We need code something like that:
<lightning-input type="number"
label="Price"
value="12345"
formatter="currency"
currencyIsoCode="EUR">
</lightning-input>
Last line: currencyIsoCode="EUR"
it's what I need to set.
Thank you.
Best Answer
Unfortunately, the same problem exists in aura, but the workaround is to use ui:inputcurrency . LWC does not have
ui-inputcurrency
equivalent yet and thus you have to build it yourself.You can use SLDS classes to give lightning look, you can refer my sample:
Playground Link : https://developer.salesforce.com/docs/component-library/tools/playground/jee6KjW0-/1/edit