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

Salakhetdinov Shamil mcp2004 at mail.ru
Fri Dec 23 10:05:04 CST 2011


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
> 
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list