incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pedro Narciso GarcĂ­a Revington <p.reving...@gmail.com>
Subject Re: decimal and builtin _sum function
Date Fri, 15 Nov 2013 11:55:14 GMT
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.



2013/11/15 Mike Marino <mmarino@gmail.com>

> > To answer the original question, _sum can only sum numbers, it does
> > not understand numbers inside strings.
> >
>
> The way I understood the OP's question was that he had correctly,
> following the error message, converted to using numbers instead of
> strings, but then didn't understand the obtained result.
>
>
> >> sidenote: super cool talk by Bartek Szopka about floating point numbers
> in
> >> JavaScript (and other languages) held at JSConf.eu 2013
> >>
> >> https://www.youtube.com/watch?v=MqHDDtVYJRI
>
> This is interesting, nice.  I come from a background where numerical
> precision and memory layout is often a concern (e.g. physics
> simulations, hardware readout), but these types of things I think can
> be more easily forgotten when using higher level languages like
> javascript, python, etc.  Imo it's still an essential understanding to
> have.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message