Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 31B4710E34 for ; Fri, 15 Nov 2013 17:01:38 +0000 (UTC) Received: (qmail 11404 invoked by uid 500); 15 Nov 2013 17:01:36 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 11369 invoked by uid 500); 15 Nov 2013 17:01:36 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 11361 invoked by uid 99); 15 Nov 2013 17:01:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Nov 2013 17:01:35 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [209.85.192.171] (HELO mail-pd0-f171.google.com) (209.85.192.171) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Nov 2013 17:01:28 +0000 Received: by mail-pd0-f171.google.com with SMTP id z10so2159382pdj.2 for ; Fri, 15 Nov 2013 09:01:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=rtqLQNB4w4JkP51b0Oi/JqKFUmpa9eOscMOA4S88pzM=; b=VVPDGeHErRmb8v8Ex/ntCVGgq+MdlbbzN94A4YB5n1tA7taQzQ7BV1h6TJHOxph465 ykLv6U14EZNAbq+3yuVM7gjtihWLRMqxUaCcZh7sbZQAKs9ZAlLKKWPMIhnWG1GPoQph T4Vt9JjMplt/jixZ8PSY0jSMF4Av56wWo/KkPmKLQSA9SPPiKmx493QUhYoiUCbMBwvK q+/GKYewzrlhzyJwdCWT/oNRarWZ8EEh0yyF+EouglTg8UyWnBt+xhFBkbCOwIeCgJMY kVNYkYJvJijcC/lyb9Q0AI8KHL9d41S14Mj2rzjYKuAdY7F8BXzu46ijYD/yo9EgNsD3 kD+A== X-Gm-Message-State: ALoCoQmo/M1ROWANi2B0RjzcrEs/7bQCR4jDQCxAbZlR0iy0HXIEHLDjSGNJQFhEidcGuIJyytUD X-Received: by 10.68.197.200 with SMTP id iw8mr169174pbc.197.1384534867043; Fri, 15 Nov 2013 09:01:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.70.95.66 with HTTP; Fri, 15 Nov 2013 09:00:26 -0800 (PST) X-Originating-IP: [68.5.117.177] In-Reply-To: References: From: Mark Hahn Date: Fri, 15 Nov 2013 09:00:26 -0800 Message-ID: Subject: Re: decimal and builtin _sum function To: user Content-Type: multipart/alternative; boundary=e89a8ff1cb42ee094104eb3a2482 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8ff1cb42ee094104eb3a2482 Content-Type: text/plain; charset=ISO-8859-1 Numbers are 100% supported in JSON and JavaScript. You would never have a problem using real numbers. I don't know where you picked up that myth. BTW, It's also a myth that you can't do accounting in JS. JS number have 52 real bits. You just need to round at the appropriate points in your code. On Fri, Nov 15, 2013 at 8:56 AM, Nick North wrote: > On 15 November 2013 16:28, Mark Hahn wrote: > > > > I store the numbers as strings because I read this the proper way for > > decimals. > > > > Where did you read this? That makes no sense. > > > > > If your numbers are going to pass through JSON and JavaScript, then I'd say > it's reasonable. There are sufficient unknowns with JSON parsers and > serialisers and processing engines along the way that storage as strings > feels the safest thing to do. > > Nick > --e89a8ff1cb42ee094104eb3a2482--