On 21 December 2020 at 12:12, Peter West said: > I don’t understand why "total_amount-(total_amount/2)” doesn’t work. > I’m assuming that two formulae are used: total_amount/2 & > total_amount-(total_amount/2), as the OP specifies. > > If the amount is odd, the first should be (given consistent truncation of > the dividend by integer division) equivalent to (total_amount -1) / 2, > which when subtracted from total_amount will leave an odd result. If it > doesn’t do this, then there is a serious problem with Gnucash > arithmetic.
That obviously depends on when the rounding occurs. The OP's example suggests it happens as late as possible, as one would reasonably expect. If so, adding 0.005 to whichever of the two is required to be rounded up is guaranteed to produce the desired effect. _______________________________________________ gnucash-user mailing list [email protected] To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information. ----- Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All.
