[GNC] Bill total does not match real total

Michael or Penny Novack stepbystepfarm at comcast.net
Wed Mar 6 17:11:29 EST 2024


> OK, Found the bug.  The problem is that the tax is totaled up using sub-penny calculations. That causes a 1.004 + 1.004 to equal 2.008 which is then rounded to 2.01.  Each line should be rounded to the penny first, then rounded up.  So if 1.004 is first rounded to 1.00, then that would cause this calculation to total 2.00, not 2.01.
>
> If that makes any sense :-)  Guess I will enter a bug on this.

Speaking as somebody who spent decades in the cypher mines (a rather 
senior systems analyst/business analyst)

a) There is no rule in mathematics how/where rounding should take place. 
It is simply true that rounded A + rounded B does not necessarily = 
rounded (A+B)

b) So a program might be defined to be correct (or wrong) depending on 
what it does during rounding COMPARED TO THE FORMAL PROGRAM DEFINITION. 
I other words, during the "requirements phase" of the project when a 
committee of "clients" sat with business analysts and this formal 
document was created << this process normally budgeted for about 20% of 
project time -- "people-hours" >>

c) OH --- this is software produced by volunteer designers/coders. There 
was NO formal definition of what was t be done in all situations because 
no corresponding team of volunteer "clients" (program users) for that 
phase of the project, coming up with the formal definition. THEN this 
sort of thing CAN'T be a "bug". Can't be because there never was a 
defined "should do".

Understand what I am saying? The "client community" can most certainly 
request a change to what has now been decided. That is not one person. 
Instead of filing a "bug report" ask fellow gnucash users to volunteer 
for a TEAM to get together and decide what the program SHOULD do, and 
once decided, ask for that change. Wearing my old business analyst hat 
for a moment, sitting at a meeting of that committee I'd ask ":what are 
the sales tax rules for YOUR jurisdiction?" < when multiple items are 
bought at the same time>  That's what we do, ASK QUESTIONS (based on 
what our experience tells us will likely be a problem -- that there will 
NOT be uniformity about that.

FOR EXAMPLE --- many (most?) US states that have sales tax do NOT use 
rounding if you are worrying about cents. The tax is a cent for any 
fraction of a cent (round up the cents)

Michael D Novack




More information about the gnucash-user mailing list