A97 Rounding

G

Guest

Hello,
I'm using A97 and I am trying to round a number to two decimal places. Since the Round function was not introduced to Access until A2k, how do I round this number? After rounding this number, I want to convert to a string. I have gotten the number to "appear" rounded, but when I use the CSTR function, it makes shows it has having three decimal places again. Any help would be appreciated!
Thanks
Willy
 
W

Wayne Morgan

The Round function introduced in Access 2000 using "banker's" or
"scientific" rounding, this rounds 1/2 to the nearest even number instead of
rounding up. To do the normal rounding up at 1/2 and round to 2 decimals:

RoundedResult = Int(NumberToRound * 100 + 0.5) / 100

--
Wayne Morgan
MS Access MVP


Willy said:
Hello,
I'm using A97 and I am trying to round a number to two decimal places.
Since the Round function was not introduced to Access until A2k, how do I
round this number? After rounding this number, I want to convert to a
string. I have gotten the number to "appear" rounded, but when I use the
CSTR function, it makes shows it has having three decimal places again. Any
help would be appreciated!
 

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

Top