How to use Intl.NumberFormat in business rule?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2023 07:00 AM
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2023 07:04 AM
Hi @Lucas11 ,
Below is the sample test script for Intl.NumberFormat
// Get the number you want to format
var number = current.amount;
// Create a new Intl.NumberFormat object for currency formatting
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
});
// Format the number as a currency
var formattedNumber = formatter.format(number);
// Update the field with the formatted number
current.amount = formattedNumber;