Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F0CB91892E for ; Fri, 22 May 2015 22:43:17 +0000 (UTC) Received: (qmail 36984 invoked by uid 500); 22 May 2015 22:43:17 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 36945 invoked by uid 500); 22 May 2015 22:43:17 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 36933 invoked by uid 99); 22 May 2015 22:43:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2015 22:43:17 +0000 Date: Fri, 22 May 2015 22:43:17 +0000 (UTC) From: "Tyler Hobbs (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-9224) Figure out a better default float precision rule for cqlsh MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-9224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tyler Hobbs updated CASSANDRA-9224: ----------------------------------- Attachment: 9224-2.1.txt > Figure out a better default float precision rule for cqlsh > ---------------------------------------------------------- > > Key: CASSANDRA-9224 > URL: https://issues.apache.org/jira/browse/CASSANDRA-9224 > Project: Cassandra > Issue Type: Improvement > Components: Tools > Reporter: Tyler Hobbs > Assignee: Stefania > Labels: cqlsh > Fix For: 3.x, 2.1.x, 2.2.x > > Attachments: 9224-2.1.txt > > > We currently use a {{DEFAULT_FLOAT_PRECISION}} of 5 in cqlsh with formatting {{'%.*g' % (float_precision, val)}}. In practice, this is way too low. For example, 12345.5 will show up as 123456. Since the float precision is used for cqlsh's COPY TO, it's particularly important that we maintain as much precision as is practical by default. > There are some other tricky considerations, though. If the precision is too high, python will do something like this: > {noformat} > > '%.25g' % (12345.5555555555555555,) > '12345.55555555555474711582' > {noformat} > That's not terrible, but it would be nice to avoid if we can. -- This message was sent by Atlassian JIRA (v6.3.4#6332)