round(x, places, mode). RSL keeps every value exact until a
round changes it. So the premium rounds exactly where the filing says, and only there.
Round to cents or dollars
round takes three parts: the value, the number of decimal places, and the mode.
The dwelling-fire rater from Write your first rater rounds each item charge to cents:
2rounds to cents,0to whole dollars, and-1to tens of dollars.- The mode is required. Write the mode the filing states.
- A value already on the target, such as 2.10 rounded to cents, stays the same in every mode.
Choose the mode
Save this rater as
round-modes/rater.rsl. It rounds one amount to cents in four of the modes:
Complete example: round-modes/rater.rsl
Complete example: round-modes/rater.rsl
round-modes/rater.rsl
round cites the filed rounding rule, and each rounded value is a rating outcome.
Rate 2.125, -2.125 and 2.121:
Round the premium and cite the rule
Each returned premium needs an explicit rounding operation with a citation on the calculation that performs it. Useround(value, places, mode) and cite the filing’s rounding rule on that calculation.
E-OUTCOME-ROUND identifies a missing premium-rounding operation or citation.
Apply a minimum premium
Wrap the rounded premium inmax with the filed minimum. Save this rater as minimum/rater.rsl:
Complete example: minimum/rater.rsl
Complete example: minimum/rater.rsl
minimum/rater.rsl
- A
maxorminof rounded values and constants counts as rounded, so this premium passes the outcome-rounding rule. round(max(x, minimum_premium), 0, half_up)passes too. Write the order the filing states.- A
maxover an exact value, such asmax(x, minimum_premium)alone, getsE-OUTCOME-ROUND. mincaps a premium at a filed maximum in the same way.
Round after each factor
Some filings multiply a chain of factors and round after each one. Save this rater asround-stepwise/rater.rsl:
Complete example: round-stepwise/rater.rsl
Complete example: round-stepwise/rater.rsl
round-stepwise/rater.rsl
combined calculation writes a product with by, to fix the order, and round_each.
The rater sorts the factors by order, multiplies them in turn, and rounds to 4 places after each
step. Two factors of 1.00005 give 1.0002. One round at the end gives 1.0001:
explain lists each input, then each calculation in order, with its exact value.
bynames a number or date input of each element.- Each
ordervalue appears once. The rater refuses a repeat withINPUT-KEYon akeyed bylist, and withINPUT-UNIQUEon other lists. round_eachworks withsumandproduct.
Related
- Exact numbers explains why values stay exact until a
round. - Citations lists each value that needs a citation.