Lorenzo
03/07/2025, 9:54 AMCeligo AI
03/07/2025, 9:54 AMAI generated answer (using internal Slack threads):Based on the conversations, it appears that SuiteQL does not support casting to decimal for exact sums. The discrepancies you're experiencing when aggregating large numbers of records could indeed be due to floating point errors. In terms of handling the addition of amounts with two decimal places correctly, there are a few potential solutions discussed in the threads: 1. One user suggested parsing the values before adding them together. For example, instead of
salesTaxAmount + totalPrice
, you could use parseFloat(salesTaxAmount) + parseFloat(totalPrice)
. This might help to ensure that the values are treated as floating point numbers rather than strings, which could potentially help to reduce rounding errors.
2. Another user suggested creating a customization to have fields where you enter the amounts with 4 decimal places, and then a script would populate the mandatory fields (like amount, gross amount, etc.) with 2 decimal places. This could potentially help to maintain precision while still complying with NetSuite's 2 decimal place requirement for currency fields.
3. It was also suggested that you could do the calculation yourself to 3 decimals and store it somewhere non-native. However, this might not be feasible if you're relying on native functionality, as currencies get 0 or 2 decimal place precision in NetSuite.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
03/07/2025, 9:54 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.810150623
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.805178344
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.801471472
Celigo AI
03/07/2025, 9:54 AM