couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <>
Subject Re: Is fixed precision arithmetic possible in couchdb python?
Date Tue, 01 Sep 2009 12:47:03 GMT
Noah Slater had a post quite some time ago where he admonished the use
of floats for money. He said to always use two integers and figure out
the mat yourself. With floats is only a matter of time before you
start missing pennies.

It stuck with me so I thought I'd mention it.

On Tue, Sep 1, 2009 at 5:27 AM, Metin Akat<> wrote:
> Hm, this makes sense. I guess I'll go this way. Thanks
> On Tue, Sep 1, 2009 at 12:18 PM, Robert Newson<> wrote:
>> Multiply your numbers by the amount of precision you need and use
>> integers (*1000 for 3 d.p)? Using floating point to store money
>> amounts seems fraught with rounding errors.
>> B.

View raw message