Skip to main content
All monetary calculations use Decimal arithmetic (never floating-point) to ensure exact results.

Default behavior

Values are rounded using HALF_UP strategy to 2 decimal places by default. Each value is rounded once — at the end of its computation. Intermediate calculations carry full 28-digit precision to prevent rounding error accumulation.

Overriding precision

You can override the number of decimal places per request:
Valid range: 0 to 6 decimal places.

Rounding strategies

The engine supports multiple rounding strategies (configured per scheme in the DSL): Most Latin American tax authorities expect HALF_UP, which is the default for all current schemes.

Why strings, not numbers

All monetary values in API responses are serialized as JSON strings:
JSON numbers are IEEE 754 floats, which cannot represent all decimal values exactly. For example, 0.1 + 0.2 = 0.30000000000000004 in most languages. Returning strings ensures the exact computed value reaches your application without precision loss. Parse response values with your language’s decimal type: