Representing money in software
Mon Jan 2 20:26:36 CET 2006
-----BEGIN PGP SIGNED MESSAGE-----
On Jan 2, 2006, at 9:10 AM, David Hopwood wrote:
> [resend to the list; I accidentally sent it only to the poster]
> David Hopwood wrote:
>> Erlang Questions wrote:
>>> I was afraid about that.
>>> Unfortunately, these numbers represent money in my application :o(
>> It sounds like your basic problem is that you don't have an
>> specification of how your application should handle money. This
>> enumerate *all* of the monetary calculations that your app needs
>> to implement,
>> and for each one, it should specify:
I used to write financial software for a living. We ALWAYS used
integers to represent the amounts (US cents). Displays were shown in
dollars by dividing by 100...
I would recommend a shift to using pure integers (perhaps in tens or
hundredths of a Euro) for your data.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)
-----END PGP SIGNATURE-----
More information about the erlang-questions