Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D219F200CC8 for ; Fri, 14 Jul 2017 15:36:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D0AA716DB6B; Fri, 14 Jul 2017 13:36:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 210EF16DB6A for ; Fri, 14 Jul 2017 15:36:03 +0200 (CEST) Received: (qmail 45795 invoked by uid 500); 14 Jul 2017 13:36:03 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 45784 invoked by uid 99); 14 Jul 2017 13:36:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2017 13:36:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id C6438C0CD9 for ; Fri, 14 Jul 2017 13:36:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id DOo0s2zw7ITB for ; Fri, 14 Jul 2017 13:36:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D45355FD18 for ; Fri, 14 Jul 2017 13:36:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 2A4E3E0D3C for ; Fri, 14 Jul 2017 13:36:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5795B24746 for ; Fri, 14 Jul 2017 13:36:00 +0000 (UTC) Date: Fri, 14 Jul 2017 13:36:00 +0000 (UTC) From: "Csaba Skrabak (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-2048) change to_char() function to use HALF_UP rounding mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 14 Jul 2017 13:36:05 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-2048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16087322#comment-16087322 ] Csaba Skrabak commented on PHOENIX-2048: ---------------------------------------- [~elserj] [~asinghal] [~enis], do you think we need to do this in a configurable way? > change to_char() function to use HALF_UP rounding mode > ------------------------------------------------------ > > Key: PHOENIX-2048 > URL: https://issues.apache.org/jira/browse/PHOENIX-2048 > Project: Phoenix > Issue Type: Improvement > Affects Versions: verify > Reporter: Jonathan Leech > Priority: Minor > Fix For: 4.12.0 > > Attachments: phoenix-2048.patch > > > to_char() function uses the default rounding mode in java DecimalFormat, which is a strange one called HALF_EVEN, which rounds a '5' in the last position either up or down depending on the preceding digit. > Change it to HALF_UP so it rounds the same way as the round() function does, or provide a way to override the behavior; e.g. globally or as a client config, or an argument to the to_char() function. -- This message was sent by Atlassian JIRA (v6.4.14#64029)