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 6FD36E1F9 for ; Tue, 19 Feb 2013 09:08:40 +0000 (UTC) Received: (qmail 97041 invoked by uid 500); 19 Feb 2013 09:08:39 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 96861 invoked by uid 500); 19 Feb 2013 09:08:37 -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 96817 invoked by uid 99); 19 Feb 2013 09:08:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 09:08:35 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of morandini.fabio@gmail.com designates 74.125.83.49 as permitted sender) Received: from [74.125.83.49] (HELO mail-ee0-f49.google.com) (74.125.83.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 09:08:31 +0000 Received: by mail-ee0-f49.google.com with SMTP id d4so3303486eek.36 for ; Tue, 19 Feb 2013 01:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=Ou9W3/DFAF8/3vfKXeIwVO9i/tZnstUAHO8Rm43bANw=; b=WYgCrc4MF+E+iHyBSLC7PD5oeWguVzOYJzpHQTWT1pNLlqhtv810RX0Jln4Gp6JqoC E75Fv+dY8PxezBJTcuStwKLWUukEV3AAkJ/lEFyZCpGhEnnljc0sGjMpeWq8rYBnQ67k tYndfb2u4D5rSOaF7jOU822pROWb9OCFLEh2A+93QDqt1X2dIdeGlqvwYLCQhEMOpcwo uHIkcrRUCcG37F8RCU9piZzSLcxkqphhXXDER+eMYyE+93GriQEOs7fj5LM/tzCQHI7j EDHGSIsqAiJWjhRs3MV7NDqruP8WrSTKWT9lVKl+q4ka0LYKzeuKECGAx4MX8Kx9ZGRo 712w== MIME-Version: 1.0 X-Received: by 10.14.223.69 with SMTP id u45mr54663575eep.23.1361264889816; Tue, 19 Feb 2013 01:08:09 -0800 (PST) Received: by 10.14.216.71 with HTTP; Tue, 19 Feb 2013 01:08:09 -0800 (PST) In-Reply-To: References: Date: Tue, 19 Feb 2013 10:08:09 +0100 Message-ID: Subject: Re: Fixed precision of floating point number not respected in views From: Fabio Morandini To: user@couchdb.apache.org, lmorandini@ieee.org Content-Type: multipart/related; boundary=047d7b604fba33e60f04d6102e75 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b604fba33e60f04d6102e75 Content-Type: multipart/alternative; boundary=047d7b604fba33e60c04d6102e74 --047d7b604fba33e60c04d6102e74 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Luca Morandini. I'm Fabio Morandini from Italy. Where do you live? My son's name is Luca Morandini! pleased to meet you *Fabio Morandini* * *Cavagli=E0 (BI) - Italia Cell. +39 328 8436256 *morandini.fabio@gmail.com* *@mfabio* **** *Fabio Morandini* = * *** *fabio.morandini* **** *fabiomorandini* **** *morandini.fabio* **** *Rispetta l'ambiente. Non stampare questa mail se non =E8 necessario**.* 2013/2/19 Luca Morandini > Folks, > > I have stored fixed precision numbers in a database, but when they are > spit out by a view, the precision is full, and -which is worse- the > trailing decimal digits are not all zeroes. > > In other words: > > Data in the database (as I loaded them as they do appear in Futon): > { > "_id": "**4864f365b6962af5a9c4064b340017**22", > "_rev": "1-**73d234f7ed07b0fc9d4671a9f8ef9b**91", > "type": "Feature", > "properties": { > "poll_id": 2734, > "dataset": "pbc", > "ced": null > }, > "bbox": [ > 151.17281, > -33.91018, > 151.18159, > -33.90162 > ] > ... > > Output of the view: > { > "_id": "**4864f365b6962af5a9c4064b340017**22", > "_rev": "1-**73d234f7ed07b0fc9d4671a9f8ef9b**91", > "type": "Feature", > "properties": { > "poll_id": 2734, > "dataset": "pbc", > "ced":null > }, > "bbox": [ > 151.17280999999999835, > -33.91017999999999688, > 151.18158999999999992, > -33.901620000000001198 > ] > ... > > Of course, in the view I do not alter the doc (moreover, the same output > of the view is replicated when I directly request a document via the > Document API). > > Am I doing something silly ? > > Regards, > > Luca Morandini > Data Architect - AURIN project > Department of Computing and Information Systems > University of Melbourne > Tel. +61 03 903 58 380 > Skype: lmorandini > > --047d7b604fba33e60c04d6102e74 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Luca Morandini. I'm Fabio Morandini from = Italy.
Where do you live?
My son's name is Luca Morandini!
plea= sed to meet you

Fabio Morandini=A0
Cavagli=E0 (BI) - Italia

Cell. +39 328 843= 6256

morandini.fabio@gmail.com

=

@mfabio

Fabio Morandini<= /a>

fabio.morandini

fabiomorandini

morandini.fabio<= /u>

Rispetta l'ambiente. Non stampare questa ma= il se non =E8 necessario.



2013/2/19 Luca Morandini <lmorandini@= ieee.org>
Folks,

I have stored fixed precision numbers in a database, but when they are spit= out by a view, the precision is full, and -which is worse- the trailing de= cimal digits are not all zeroes.

In other words:

Data in the database (as I loaded them as they do appear in Futon):
{
=A0 =A0"_id": "4864f365b6962af5a9c4064b3400172= 2",
=A0 =A0"_rev": "1-73d234f7ed07b0fc9d4671a9f8ef9b91",
=A0 =A0"type": "Feature",
=A0 =A0"properties": {
=A0 =A0 =A0 =A0"poll_id": 2734,
=A0 =A0 =A0 =A0"dataset": "pbc",
=A0 =A0 =A0 =A0"ced": null
=A0 =A0},
=A0 =A0"bbox": [
=A0 =A0 =A0 =A0151.17281,
=A0 =A0 =A0 =A0-33.91018,
=A0 =A0 =A0 =A0151.18159,
=A0 =A0 =A0 =A0-33.90162
=A0 =A0]
...

Output of the view:
{
=A0 "_id": "4864f365b6962af5a9c4064b34001722&q= uot;,
=A0 "_rev": "1-73d234f7ed07b0fc9d4671a9f8ef9b9= 1",
=A0 "type": "Feature",
=A0 "properties": {
=A0 =A0 =A0 =A0 "poll_id": 2734,
=A0 =A0 =A0 =A0 "dataset": "pbc",
=A0 =A0 =A0 =A0 "ced":null
=A0 },
=A0 "bbox": [
=A0 =A0 =A0151.17280999999999835,
=A0 =A0 =A0-33.91017999999999688,
=A0 =A0 =A0151.18158999999999992,
=A0 =A0 =A0-33.901620000000001198
=A0 ]
...

Of course, in the view I do not alter the doc (moreover, the same output of= the view is replicated when I directly request a document via the Document= API).

Am I doing something silly ?

Regards,

Luca Morandini
Data Architect - AURIN project
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini


--047d7b604fba33e60c04d6102e74-- --047d7b604fba33e60f04d6102e75--