>Hi,
>
>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.
>
Easiest would be to find the unit of currency divisor needed, multiply the money amount by the divisor, rounding to the nearest integer, and then dividing the result by the divisor again; eg to get to the nearest quarter:
.25 = 1/4; the divisor is 4
? ROUND(yDollarAmount * 4,0)/4