ANS-0784 · WEB SERVICES & INTEGRATIONS
How to Resolve Currency Rounding Discrepancies Between NetSuite and PayPal
Ensure consistent payment amounts by addressing how NetSuite and PayPal handle three-decimal currency values.
Short answer
To prevent payment inconsistencies arising from differing rounding rules, ensure all currency values sent to PayPal are explicitly rounded to two decimal places. This practice aligns NetSuite's output with PayPal's rounding behavior, preventing discrepancies when processing amounts with three or more decimal places.
Scenario
A common issue arises when integrating NetSuite with PayPal, specifically concerning how currency amounts are rounded. For instance, if a transaction value of 6.115 is processed, PayPal may round the amount to 6.11, while NetSuite's default rounding might result in 6.12. This difference creates an inconsistency in payment records and can lead to reconciliation challenges.
Solution
To resolve this discrepancy, it is essential to ensure that all currency values transmitted to PayPal are explicitly rounded to two decimal places. This can be achieved in SuiteScript 2.x by utilizing the N/format module. The format.format function, with type: format.Type.CURRENCY, will apply standard currency rounding to the specified value.n
javascriptn/**n * @NApiVersion 2.xn * @NModuleScope Publicn */ndefine(['N/format'], function(format) {n function getRoundedCurrencyValue(amount) {n return format.format({n value: amount,n type: format.Type.CURRENCYn });n }n // Example usage:n // var roundedAmount = getRoundedCurrencyValue(6.115);n});nExpert NetSuite Support
Need help with this NetSuite issue?
Web Services & Integrations consulting and configuration support
