[GNC] Rounding & formulas

Adrien Monteleone adrien.monteleone at lusfiber.net
Mon Dec 21 22:09:57 EST 2020


Or just correct a single digit as desired upon review when the 
transaction is created? (on the off chance the original sum is an odd 
number, which isn't always, and if I recall correctly, this is a *one 
time per month* transaction, thus from 1 to 12 times *per year* the 
transaction won't magically round as desired.)

Regards,
Adrien

On 12/21/20 5:12 PM, Dale Alspach wrote:
> I think the problem is that with late rounding the formula may not work.
> Suppose the amount is 0.21.
> Compute amount/2 exactly: 0.21/2=0.105
> Subtract from amount 0.21 - 0.105=0.105
> For a fixed rounding scheme both will either be 0.11 or 0.10 and the sum
> will be 0.22, respectively, 0.20. Neither is the desired 0.21.
> 
> If the sum is to be correct, one could try to implement amount1 =
> round(amount/2). amount2 = amount - amount1.



More information about the gnucash-user mailing list