incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Marino <mmar...@gmail.com>
Subject Re: decimal and builtin _sum function
Date Fri, 15 Nov 2013 12:01:41 GMT
On Fri, Nov 15, 2013 at 12:55 PM, Pedro Narciso GarcĂ­a Revington
<p.revington@gmail.com> wrote:
> Yes, I'm dealing with money but also with micro decrements (cost per
> impression on ads).
> So my decrements are going to be like 0.000123.
> I think what I'm going to do is to sum them before push them into couchdb
> so I do not need to deal with decimals.

Just to be sure, this isn't specifically an issue with couch, it's a
general issue with numerical precision.  You will likely always need
to either sum them exactly (i.e. use integers of your smallest
denomination) or make sure you round properly at the end and quantify
the max error.

Mime
View raw message