formatting of currency values in kmmsplits table

Thomas Baumgart thb at net-bembel.de
Tue Nov 15 15:42:42 GMT 2022


On Dienstag, 15. November 2022 09:08:44 CET Chris via KMyMoney-devel wrote:

> Thanks
> 
> I have always used integer's, never floats or doubles, I realised back in 
> the 90's that was a mistake when implementing credit card transactions. 
> Rounding errors bite hard.
> 
> I have always decided at the start of a project what was the maximum 
> precision needed, usually 2 decimal places but occasionally more. I can see 
> with kmymoney 4 digits is the best because I believe that is normal for 
> shares. however I don't do shares so I could be wrong.
> 
> Just looked it up, shares below $1.00 is to 4 decimal places, 2 places 
> otherwise.
> 
> I can see storing it using numerator denominator is more flexible.

4 digits is not enough if it comes to currency exchange. We do have a user
that converts between (I believe) Indonesian Rupia and Euros a lot and
needs at least 10 digits of precision for the price to get correct results.

-- 

Regards

Thomas Baumgart

-------------------------------------------------------------
Testing can only prove the presence of bugs, not their absence.
 -- Edsger W. Dijkstra, 1969
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 868 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20221115/783e2006/attachment.sig>


More information about the KMyMoney-devel mailing list