Skip to main content
Install Relativities and download the synthetic examples before running this page. This page rounds values with 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.
  • 2 rounds to cents, 0 to whole dollars, and -1 to 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

This rater rounds one amount to cents in each mode:
Rate 2.125, -2.125 and 2.121. The sample download includes this rater in relativities-examples/rsl/round-modes:
The modes differ on a half, such as 2.125, and on negative amounts.

Round the premium and cite the rule

Each premium the rater returns passes through a round. A premium with a step after its last round fails the check:
The calculation that rounds the premium also cites the rounding rule, on the calculation itself. A citation on the whole step falls short:
Write the citation after the type, before =, as the first example on this page does.

Round after each factor

Some filings multiply a chain of factors and round after each one. Write 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. The sample download includes this rater in relativities-examples/rsl/round-stepwise:
  • by names a number or date input of each element.
  • Each order value appears once. The rater refuses a repeat with INPUT-KEY on a keyed by list, and with INPUT-UNIQUE on other lists.
  • round_each works with sum and product.
  • Exact numbers explains why values stay exact until a round.
  • Citations lists each value that needs a citation.