ROUNDING A NUMBER

  • Thread starter Thread starter Greg McLandsborough
  • Start date Start date
G

Greg McLandsborough

I have a number on a (Sum [price]) and I want to round the result to the
nearest $25.00

Is there a way to do this.

Thanks in Advance

Regards

Greg McLandsborough
 
Al has it started correctly, but to get to the "nearest" $25, you need to
round the result of the division to the nearest ones place then multiply by
25.

Example:
Int(Round(YourNumber / 25)) * 25

If you don't want to use the built-in rounding function, but instead prefer
to round .5 up all of the time, you'll need to round the division yourself
to the nearest ones place.

Example:
Int(YourNumber / 25 + 0.5) * 25
 
Wayne,
I missed that "nearest"... thanks for picking that up.
Al Camp

Wayne Morgan said:
Al has it started correctly, but to get to the "nearest" $25, you need to
round the result of the division to the nearest ones place then multiply
by 25.

Example:
Int(Round(YourNumber / 25)) * 25

If you don't want to use the built-in rounding function, but instead
prefer to round .5 up all of the time, you'll need to round the division
yourself to the nearest ones place.

Example:
Int(YourNumber / 25 + 0.5) * 25

--
Wayne Morgan
MS Access MVP


Greg McLandsborough said:
I have a number on a (Sum [price]) and I want to round the result to the
nearest $25.00

Is there a way to do this.

Thanks in Advance

Regards

Greg McLandsborough
 
Back
Top