How about this:
FUNCTION Roundit
lparameters tnVal, tnRound
return tnRound * (int(tnVal/tnRound) + round(mod(tnVal,tnRound)/tnRound, 0))
ENDFUNC
>
>Does anyone have a good algorithm for rounding a number (money) to the nearest 50 cents, 75 cents, etc? I'm trying to avoid breaking it down into integer and decimal components and running through a case statement. I'm hoping for some slick one or two line UDF.
>
>thanks!
>Ken
Peter Franz