phone: (540)338-0194
email: ken@kenhamady.com

´╗┐

 Crystal Reports formula examples

Rounding to the nearest 5 cents (or other odd increment):

Rounding to the nearest penny, dime, dollar or thousand dollars is simply a matter of using the round function and specifying the correct number of decimals.  But what if you need to round to the nearest increment of something other than 1.  If you are using Crystal Reports v11 (XI) or later you can use the MRound function:

    MRound ( {database.field}, .05)


For those of you who are still using Crystal Reports v10 or earlier, here is a version that will work for you. Thanks to Mike Barron who found this formula long ago on an Excel forum and shared it with me. 



    Round ( {database.field} / .05 , 0 ) * .05