Round values up and down

G

Guest

I need to be able to round values to this specification using vba in Access2003

£0.005 or less is disregarded, we only look at the third decimal place.

If it is 5 or less round down.
If it is 6 or more round up.

For example,
£67.5558 would be £67.55.
£67.5568 would be £67.56.

ive been using the round function but it rounds up at 5 and down at 4 but i
need it to round up at 6 and down at 5.

Can anyone help please??
 
G

Guest

I posted before but I'm not sure if the answer went through. I'll try again

IIF([FieldName] =
Round([FieldName],3),Round([FieldName],2),Round([FieldName]-0.001,2))

I tried few cases and it worked, but there might be a case that I didn't check
 
G

Guest

Try something like

IIF(aaa =
Round([YourNumber],3),Round([YourNumber],2),Round([YourNumber]-0.001,2))

I tried few cases and it worked but mybe I didn't cover all cases
 
G

Guest

Many thanks, seems to be doing what i want it too.

Once again thanks.


Ofer Cohen said:
I posted before but I'm not sure if the answer went through. I'll try again

IIF([FieldName] =
Round([FieldName],3),Round([FieldName],2),Round([FieldName]-0.001,2))

I tried few cases and it worked, but there might be a case that I didn't check

--
Good Luck
BS"D


StuJol said:
I need to be able to round values to this specification using vba in Access2003

£0.005 or less is disregarded, we only look at the third decimal place.

If it is 5 or less round down.
If it is 6 or more round up.

For example,
£67.5558 would be £67.55.
£67.5568 would be £67.56.

ive been using the round function but it rounds up at 5 and down at 4 but i
need it to round up at 6 and down at 5.

Can anyone help please??
 

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

Rounding Values 2
Round up or down in .5 increments 6
round-to-even logic 7
Always Round Down 7
ALWAYS ROUND UP 3
Round Function 5
Round formula 1
Round up to a specific figure 4

Top