[AccessD] My Excel project...you won't believe this one

Gustav Brock gustav at cactus.dk
Sat Dec 24 09:35:46 CST 2011


Hi Shamil

Well, that article is more about the normal precautions to take when dealing with floating point numbers more than rounding issues.

It is with rounding as with many other tasks that many methods exist and no one is wrong. It all depends.

/gustav


>>> mcp2004 at mail.ru 23-12-2011 17:05 >>>
Hi Mark, Gustav at all --

> Are you sure MSFT did not "fix" Round in later versions ?
They didn't.

> So bottomline: VBA side....Format and Round produce difference results
Yes, the do.

 Access 2010:

?round(2.5)
 2 
?format(2.5, "0")
3

Proper rounding in VBA is a long story originated here:

http://www.fmsinc.com/tpapers/math/index.html 

or even earlier...

Thank you.

-- Shamil

23 декабря 2011, 17:29 от "Mark Simms" <marksimms at verizon.net>:
> Thanks Gustav. Once again, we've got versions 2003, 2007, 2010.
> So bottomline: VBA side....Format and Round produce difference results ?
> 
> > Hint: The only native function of VB(A) that handles 4/5 rounding
> > correctly is Format. It is, however, not very fast so if speed is a
> > concern you have to run a custom function. And no, the VB(A) function
> > Round is not the answer to any serious task:
> >
> >
> > /gustav






More information about the AccessD mailing list