nsformat_*()

NetSuite formatting is lost when you customize NetSuite standard fields. If you print hard-coded values which came from a custom data source or were calculated from standard fields, the format will not be consistent with the format of standard record fields. When editing the template source code, the nsformat_*() formatting method makes it possible to format FreeMarker custom variables in the same way NetSuite formats standard fields. It also decreases the need for hardcoding. The nsformat_*() method formats the specific string, number, date, or amount results in the same format used on a standard NetSuite field. With this formatting method, it is possible to apply localization to custom variables, ensuring consistent output.

The following table shows some examples of standard fields in use:

The following table shows some examples of the ${nsformat_*()} formatting method in use:

Formatters accept numbers in double precision floating point representation.

If the input is an empty string or null value, then the output is also represented as an empty string.

Leave a comment

Your email address will not be published. Required fields are marked *