Formatting currency...
 
Notifications
Clear all

[Solved] Formatting currency fields in LWC

2 Posts
1 Users
0 Likes
728 Views
Posts: 205
 CWL
Admin
Issue starter
(@cwl)
Member
Joined: 11 years ago

How to do formatting on currency fields and percentages in LWCs?

Issue Tags
lwc
1 Reply
Posts: 205
 CWL
Admin
Issue starter
(@cwl)
Member
Joined: 11 years ago

Learn more here: lightning-formatted-number - documentation - Salesforce Lightning Component Library

Here is an example:

<td>
    <lightning-formatted-number
        value={quoteItem.C1DDC__c}
        format-style="currency"
        currency-code={quoteItem.CurrencyIsoCode}
        minimum-fraction-digits="0">
    </lightning-formatted-number>
</td>
<td>{quoteItem.C1DDP__c}</td>
<td>
    <lightning-formatted-number
        value={quoteItem.C1DDAPPEMP__c}
        format-style="percent-fixed"
        currency-code={quoteItem.CurrencyIsoCode}
        minimum-fraction-digits="1">
</td>
Reply
Share: