HOW TO: Format percentage values for NetSuite with the required one decimal point
NetSuite needs the percentage values to have one decimal point, so a value of -25% should be -25.0. Here is an example:
-{{toFixed (divide payout_costs.commission_bps "100") 1}}%
Here is an example to convert the rate field value via mapping:
These functions are case-sensitive, so make sure that you're using lowercase for divide, not uppercase. When you test your format, you can see that "divide" (lowercase) will work, whereas "DIVIDE" (uppercase) will not.
This is just one of the many examples on how to combine different handlebar helpers in one expression. We have a great Handlebars library, including divide and ToFixed handlebarsI
You'll also probably want to check out our Inline handlebar helpers and Nested Expressions
Let us know if you have other handlebars questions we can help you with here on our community! Also, let us know if there's any information you'd like us to add to our handlebars documentation!
0
Please sign in to leave a comment.
Comments
0 comments