Boost logo

Boost Users :

From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2005-04-15 12:37:59


Sliwa, Przemyslaw (London) wrote:
> Thanks,
>
> Ben, what should I use for representing the money amounts?
> A boolean :)) ?

If you're dealing with other people's money then there are regulations
that specify the required intermediate precision and rounding rules,
which may vary from place to place. I believe you'll need to use
fixed-point decimal fractions, perhaps implemented as integer counts of
hundredths or ten-thousandths of a currency unit. I've not done this
myself so I don't know the details, but I'm fairly sure that getting
this wrong can put you on the wrong side of the law.

Ben.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net