Skip to content

Rounding in Crystal Reports: Rounding to Unusual Amounts

You can quickly round to the nearest decimal place, but what if you need to round to an unusual point? For example, the nearest eighth mile? Or the nearest quarter hour? These activities are often done when calculating time sheets or mileage calculations. Fortunately, it’s relatively easy to modify the Round function to handle these odd fractions:

  1. Determine the decimal equivalent of your fraction. (1/8 is equal to .125, 1/4 is equal to .25, and so on.)
  2. Modify your Round function as follows: Round(ValueToRound/Decimal,0)*Decimal

    For example, to round to the nearest eighth mile you would enter Round({mileage}/.25,0)*.25

  3. Use this function in your calculations.

Leave a Reply