[Kmymoney-devel] MyMoneyFile::price(...) const
    Alvaro Soliverez 
    asoliverez at kde.org
       
    Mon Oct 31 19:23:04 UTC 2011
    
    
  
Hello Al,
MyMoneyPrice is not a single value. It contains the currencies involved and
the date.
You can then call MyMoneyPrice::rate(currencyId) to get the MyMoneyMoney
value you want.
Regards,
Alvaro
On Mon, Oct 31, 2011 at 3:12 PM, <Software at quantentunnel.de> wrote:
> Hi
>
> 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.
>
> I do not understand the function below from mymoneyfile.cpp
>
> MyMoneyFile::price(const QString& fromId, const QString& toId, const
> QDate& date, const bool exactDate) const
> {
> ...
>  // search 'from-to' rate
>  MyMoneyPrice rc = d->m_storage->price(fromId, to, date, exactDate);
>  if (!rc.isValid()) {
>    // not found, search 'to-fron' rate and use reciprocal value
>    rc = d->m_storage->price(to, fromId, date, exactDate);
>  }
>  return rc;
> }
>
> 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?
>
> Thanks
>
> Al_
> --
> NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
> Jetzt informieren: http://www.gmx.net/de/go/freephone
> _______________________________________________
> KMyMoney-devel mailing list
> KMyMoney-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kmymoney-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20111031/dc56b01b/attachment.html>
    
    
More information about the KMyMoney-devel
mailing list