Hello Al,<br>MyMoneyPrice is not a single value. It contains the currencies involved and the date.<br><br>You can then call MyMoneyPrice::rate(currencyId) to get the MyMoneyMoney value you want.<br><br>Regards,<br>Alvaro<br>
<br><div class="gmail_quote">On Mon, Oct 31, 2011 at 3:12 PM,  <span dir="ltr"><<a href="mailto:Software@quantentunnel.de">Software@quantentunnel.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi<br>
<br>
To provide a first small piece of code (to add currency conversion to kMyMoneyCalculator) I started to look at the relevant source code, downlodade about a week ago.<br>
<br>
I do not understand the function below from mymoneyfile.cpp<br>
<br>
MyMoneyFile::price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const<br>
{<br>
...<br>
  // search 'from-to' rate<br>
  MyMoneyPrice rc = d->m_storage->price(fromId, to, date, exactDate);<br>
  if (!rc.isValid()) {<br>
    // not found, search 'to-fron' rate and use reciprocal value<br>
    rc = d->m_storage->price(to, fromId, date, exactDate);<br>
  }<br>
  return rc;<br>
}<br>
<br>
The comment correctly states that the reciprocal value needs to be taken, if to-from instead of from-to is returned. But there is no "1/". What am I missing?<br>
<br>
Thanks<br>
<br>
Al_<br>
<font color="#888888">--<br>
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!<br>
Jetzt informieren: <a href="http://www.gmx.net/de/go/freephone" target="_blank">http://www.gmx.net/de/go/freephone</a><br>
_______________________________________________<br>
KMyMoney-devel mailing list<br>
<a href="mailto:KMyMoney-devel@kde.org">KMyMoney-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kmymoney-devel" target="_blank">https://mail.kde.org/mailman/listinfo/kmymoney-devel</a><br>
</font></blockquote></div><br>