[SalesForce] Lightning:input format currency

Hi I am trying to display Amount field as currency format.
If I enter 10K in Amount field, it should display as 10000. But it's not happening.

Below is the tag I am using to get the Currency field value.

 <lightning:input value="{!v.oppRec.Amount}" label="Amount" required="true" type="currency" formatter="currency"/>

Best Answer

<lightning:input> fields don't understand SI abbreviations, like K for thousand or M for million. You need to either write the number out in full or implement your own logic to convert these values into actual numbers, without using the standard currency formatter.

Examples are in the Lightning Component Library, where you can see examples of how the different input types and formatters interact with one another and restrict your input options. You shouldn't be able to type a K into a number field in the first place.

Related Topic