During premium calculations (sum of premiums from Excel or database), the final output sometimes shows unexpected values, such as -0, 0.00, or very small decimals like 0.003 or -0.004.
These arise due to floating-point precision issues or rounding behavior in calculation engines like Adeptia or Excel. Such values can cause incorrect reporting or client confusion.
Solution:
Use a conditional formatting rule to normalize near-zero values and format the output consistently.
Rule:
format-number(
if (abs($varSumOfPremiums) < 0.005) then 0 else $varSumOfPremiums,
'0.##'
)
Explanation:
abs($varSumOfPremiums) ensures both positive and negative near-zero values are treated the same.
Values less than 0.005 are forced to 0 to avoid -0 or tiny decimals.
format-number(..., '0.##') formats the output to show up to two decimal places without unnecessary trailing zeros.
Approach / Steps:
Identify fields prone to floating-point rounding issues (e.g., sum of premiums).
Apply the conditional check for near-zero values.
Format the final number for client-friendly output.
Use this as a standard rule in all mapping logic where calculations are involved.
Comments
0 comments
Please sign in to leave a comment.