Hi, On Thursday 06 November 2014 12:17:23 Cristian Oneț wrote:
> Hi, > > If the AB_Value_fromString function can work with the > "numerator/denominator" format (for example: 24839/25) I would prefer > using AB_Value_fromString(value.toString().toLatin1().data()) where > value is an AlkValue (or MyMoneyMoney). This would mean using the > existing API. Not sure if AB_Value_fromString works directly with the AlkValue string representation. But using the following code should solve the problem (not optimized for readability): QRegExp exp("(-?\\d+)/(\\d+)"; if(exp.exactMatch(value.toString()) { AB_Value_fromString(exp.cap(1).toLong(), exp.cap(2).toULong()); } else { printf("Houston, we have a problem"); } > 2014-11-06 9:56 GMT+02:00 Christian Dávid <christian-da...@web.de>: > > Am Mittwoch, 5. November 2014, 20:46:20 schrieb Christian Dávid: > >> I want to use it to make AB_VALUE* AB_Value_fromMyMoneyMoney(const > >> MyMoneyMoney& input) [2] better - using double here is not good. It will > >> convert the credit transfer value from KMyMoney to aqbanking. > > > > I forgot: functions which could be used are > > > > // s is the same as used in alkimia > > AB_VALUE * AB_Value_fromString (const char *s) > > AB_VALUE * AB_Value_fromInt (long int num, long int denom) > > AB_VALUE * AB_Value_fromDouble (double i) // <- really bad, used now > > > >> [2] > >> https://projects.kde.org/projects/extragear/office/kmymoney/repository/re > >> vis > >> ions/add-onlinebanking/entry/kmymoney/plugins/kbanking/aqbankingqtoperat > >> ors. h > > > > _______________________________________________ > > KMyMoney-devel mailing list > > KMyMoney-devel@kde.org > > https://mail.kde.org/mailman/listinfo/kmymoney-devel > > _______________________________________________ > KMyMoney-devel mailing list > KMyMoney-devel@kde.org > https://mail.kde.org/mailman/listinfo/kmymoney-devel -- Regards Thomas Baumgart GPG-FP: E55E D592 F45F 116B 8429 4F99 9C59 DB40 B75D D3BA ------------------------------------------------------------- Windows are like... windows. Shiny, fragile, expensive. -------------------------------------------------------------
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ KMyMoney-devel mailing list KMyMoney-devel@kde.org https://mail.kde.org/mailman/listinfo/kmymoney-devel