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

Gustav Brock gustav at cactus.dk
Sun Dec 25 05:24:40 CST 2011


Hi William

We can't disagree on that. I work mostly with accounting systems and routines related to that where correct and predictable rounding is a high priority area.

The issue is that all the Cxx converter functions and Round too perform Banker's Rounding. This is not wrong, only different from what most people expect because very little is told about it. The Int and Fix functions work correctly too and also much more as people expect them to do. What is missing is a function that clearly and correctly performs a true 4/5 rounding as we learned in school, and very few expect the "secret" Format to be that only function which does that.

What messes up the picture further, is that Round is buggy as the test function from the link I posted shows.

/gustav


>>> vbacreations at gmail.com 24-12-2011 16:39 >>>
I disagree Gustav (and I don't like to disagree with you! Especially at
Christmas time :)

Any time you cannot guarantee a reliable result by your methods.... and are
not knowledgable or willing to inform your users under what conditions they
can expect results to be proper or improper...  that is wrong.
On Dec 24, 2011 10:31 AM, "Gustav Brock" <gustav at cactus.dk> wrote:

> 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





More information about the AccessD mailing list