Following SuiteCommerce best practices, we will use the built-in “Utils” file to convert strings into currency when required. Passing strings as numbers and converting them at the last minute can have positive effects on future code edits where number manipulation needs to happen.
The “Utils” file can be found in the SuiteCommerce source code here: “SC_version_Live > Commons > Utilities > JavaScript > Utils.ts”.
First, you will need to load the "Utils" file as a dependency in your file, as in this example:
Next, you will need to use the "formatCurrency" function, which is:
This "formatCurrency" function takes three arguments, as shown here:
We like to update our blogs and articles to make sure they help resolve any troubleshooting difficulties you are having. Sometimes, there is a related feature to enable or a field to fill out that we miss during the instructions. If this article didn't resolve the issue, please use the chat and let us know so that we can update this article!
If you have general questions about SuiteCommerce or more specific questions about how our team can support your business as you implement NetSuite or SuiteCommerce, feel free to contact us anytime. Anchor Group is a certified Oracle NetSuite Alliance Partner and Commerce Partner equipped to handle all kinds of NetSuite and SuiteCommerce projects, large or small!
We are a premium SuiteCommerce agency that creates powerful customer portals. Unlike our competitors, we have already solved your problems.
Tagged with Training