Rounding error when trying to save a sales order in NetSuite using SuiteScripts

I’m encountering an issue with ״rounding error״ when trying to save a sales order in NetSuite using SuiteScripts. The error occurs when trying to save a decimal number with 2 or 3 digits after the decimal point. Strangely, this issue only occurs in our production environment and not in our sandbox.

We’ve tried reducing the number of digits after the decimal point to 2, but the error persists. We’re using the exact same scripts in both our production and sandbox environments, so we suspect that this may be a problem with the configuration of NetSuite.

We’re unsure what may be causing this problem, so any help or insights would be greatly appreciated. Thank you in advance!

Edit: This is the error we are getting: “Rounding Error: 14973.75”, where “14973.75” is the “taxtotal” we suspect it’s a problem with the “taxtotal” field.

Here are all the fields we are setting values to (in order), just incase this gives any insight to the problem:taxDetailsOverride, shippingtax1rate, total, taxtotal


Edit 2: we successfully reproduced  the “rounding error” in our sandbox environment!

we are getting rounding error either the value of taxtotal is decimal 1-3 digits after the dot, or integer (like 7500)

the error occurs when trying to save sales order that were created before our scripts were deployed.

we still don’t know what the differences are. we are using netsuite field explorer to check the differences.

Thank you in advance!

Rookie Asked on April 9, 2023 in SuiteScript.
Add Comment
1 Answer(s)

That doesn’t look like a standard error – do you have any other scripts running?

Intermediate Answered on April 14, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Become a Sponsor   Become a Sponsor