On Dienstag, 24. März 2020 02:05:33 CET Dawid Wrobel wrote: > On Sat, Mar 21, 2020 at 1:41 PM Thomas Baumgart <t...@net-bembel.de> wrote: > > > Eventually we will do that. Guess I have to learn how to work with those > > pull requests then. > > I am looking forward to this. > > Why do you use > > > > d->m_value = d->m_value * MyMoneyMoney::MINUS_ONE; > > instead of > > d->m_value = -d->m_value; > > > > I saw it used in a similar fashion in a number of places, e.g. in > mymoneyforecast.cpp, so I assumed it was the "KMyMoney" way to do it.
Hmm, an addition is usually faster than a multiplication, hence why. That was probably written before we had a unary minus operator. > > Also, make sure to invert the sign of the MyMoneySplit::m_shares member as > > well. Otherwise, your book-keeping is off ;) > > > > Indeed, I missed that one. Thank you. Fixed and tested with an investment > account. It is not only relevant for investment transactions but used in other cases as well. E.g. it becomes important in multi-currency transactions. How do we want to proceed with your changes? I could get them from your repo and add them to KMyMoney. Thomas -- Regards Thomas Baumgart https://www.signal.org/ Signal, the better WhatsApp ------------------------------------------------------------- Q: How do you make a water bed more bouncy? A: Fill it with spring water! -------------------------------------------------------------
signature.asc
Description: This is a digitally signed message part.