Rate deviation and rounding: checking a calculation
Updated November 8, 2026
Check the rule in calculation order. Exrule converts the market rate to the displayed scale and applies inversion if invert_export_quote is enabled. The system then applies deviation, rounding and bounds. The operator sets the deviation sign. The system adds absolute deviation after inversion and before rounding.
Establish what deviation changes
Percentage deviation depends on the size of the reference rate. For a positive deviation of p percent, the illustrative formula is B × (1 + p / 100). A negative deviation changes the sign of the adjustment. Absolute deviation adds or subtracts a stated number of rate units regardless of the reference scale.
Illustrative example: the reference is 25.00. A +0.8% deviation adds 0.20 and produces 25.20. An absolute deviation of +0.08 produces 25.08. These settings are not interchangeable. If the reference rises to 30.00, the same +0.8% produces 30.24, while +0.08 produces 30.08.
Before choosing a sign, write down the rate direction. A larger number means more destination units per source unit only with that direct presentation. Do not use better or worse in place of units. Check the arithmetic separately for an inverse presentation.
Check whether precision removes the visible adjustment
Illustrative example using ordinary rounding to two decimal places: a reference of 7.231 plus an absolute deviation of 0.002 gives 7.233. Rounding produces 7.23. Without the adjustment, the rounded result would also be 7.23. The saved deviation takes effect here, but it is invisible in the final number.
Another illustrative example: a reference of 18.432 with +0.2% gives 18.468864. Rounding to two places produces 18.47. If the rule maximum is 18.46, that bound caps the result at 18.46. Increasing deviation in this case cannot raise the final rate above the maximum.
Exrule only warns when deviation is smaller than the rounding step. The system rounds within the allowed corridor. For the same inputs, preview, the run record and XML show the same final rate. The educational examples state their rounding assumption and avoid values exactly halfway between two results.
Compare the manual calculation with the panel
If numbers differ, locate the first calculation stage that diverges. Checking decimal places alone cannot resolve a different reference. If intermediate values match but the final value differs, check bounds and change protection. Avoid changing several parameters at once during this investigation.
- Record the reference for the moment you are testing. New market data may change it between two previews.
- Record the deviation type, sign and units. Calculate the intermediate value before rounding.
- Apply the agreed precision, then the minimum and maximum. Check per-run change protection separately.
- Compare the result with Next run. Use Now in file to compare against the last publication.
- After a completed export, read the XML and check the value received by your platform.
Separate the platform's own rounding
Your exchanger platform may have its own display or calculation precision. Establish that from its documentation. A value of 18.46 in XML and a shorter number on the page do not yet prove an Exrule error. Compare the number the platform stored with the number it merely displays to the visitor.
For a control check, take one amount and calculate the result using the rate actually imported. Record any separate platform conditions that apply. This test distinguishes precision loss during import from text formatting on the website. Exrule preview does not automatically verify that final stage.
Check the sign in the inverse direction
At a direct rate of 4 units of B per A, the inverse is 0.25 units of A per B. Raising the direct rate to 5 lowers the inverse to 0.20. This separate illustrative example checks the sign. It does not justify copying the same absolute deviation to an inverse rule. Write the intended ratio in words before changing the adjustment sign.
Common calculation mistakes
- Entering 0.5 units instead of 0.5% and comparing adjustments with different meanings.
- Rounding the reference manually before applying deviation and producing a different result.
- Increasing the adjustment when the final rate already sits at its maximum.
- Comparing an old published rate with a new reference without considering export time.