Round to the nearest 5 cent

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please help. If my value is $0.04 and below then round down to $0.00. If the
value is $0.05 then return the same value. If it is $0.06 and above then
return a value of $0.10.

Thanking you
 
Here's one (of many) way to do it:

RoundedValue = MyValue-(IIf((MyValue-Fix(MyValue))*100 Mod
10<5,(MyValue-Fix(MyValue))*100 Mod 10,IIf((MyValue-Fix(MyValue))*100 Mod
10=5,0,(MyValue-Fix(MyValue))*100 Mod 10-10))/100)
 

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

Back
Top