On Thursday 06 December 2007 08:01:09 Thomas Baumgart wrote: > 6:2007/12/06 07-49-13:(null)(26600):mymoneybanking.cpp: 527: Adding > transaction > Value: > 58184456566852616694523094906498756766597/425352958651173079329218259289710 >26432 (1367.91 EUR) > num = 5902958103587056517 (51eb851eb851eb85) > denom = 504684641933067010 (701000206040302) > MyMoneyMoney(5902958103587056517/504684641933067010) > MyMoneyMoney(0,0000) > > Das zugehörige Code Snippet im kmm_plugin sieht folgendermassen aus: > > AB_Value_Dump(val, stderr, 2); > > int64_t num = AB_Value_GetNumerator(val); > int64_t denom = AB_Value_GetDenominator(val); > fprintf(stderr, "num = %ld (%lx)\n", num, num); > fprintf(stderr, "denom = %ld (%lx)\n", denom, denom); > > kt.m_amount=MyMoneyMoney(num, denom); > > fprintf(stderr, "MyMoneyMoney(%s)\n", kt.m_amount.toString().data()); > fprintf(stderr, "MyMoneyMoney(%s)\n", > kt.m_amount.formatMoney("",4).data());
[...] Kleiner Nachtrag noch (der erste Kaffee wirkt noch nicht so richtig und der Finger war schon auf dem Send Button). Der Umweg über ein 'double' funktioniert: 6:2007/12/06 08-03-37:(null)(30199):mymoneybanking.cpp: 530: Adding transaction Value: 58184456566852616694523094906498756766597/42535295865117307932921825928971026432 (1367.91 EUR) MyMoneyMoney(136791/100) MyMoneyMoney(1.367,9100) AB_Value_Dump(val, stderr, 2); double f = AB_Value_GetValueAsDouble(val); kt.m_amount=MyMoneyMoney(f); fprintf(stderr, "MyMoneyMoney(%s)\n", kt.m_amount.toString().data()); fprintf(stderr, "MyMoneyMoney(%s)\n", kt.m_amount.formatMoney("", 4).data()); -- Regards Thomas Baumgart GPG-FP: E55E D592 F45F 116B 8429 4F99 9C59 DB40 B75D D3BA ------------------------------------------------------------- There are only 10 types of people in the world: those who understand binary arithmetic and those who don't. -------------------------------------------------------------
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________ Aqbanking-devel mailing list Aqbanking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/aqbanking-devel