Round values up and down

  • Thread starter Thread starter Guest
  • Start date Start date
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??
 
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
 
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
 
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??
 
Back
Top