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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Number Field Automatically Rounding Decimals 3
rounding to nearest 5000 4
Rounding Up To Even number 1
VLOOKUP Question 27
Rounding 1
Rounding Percentage 4
Word Macro that Rounds 0
Round Question 3

Back
Top