You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Csaba Skrabak (JIRA)" <ji...@apache.org> on 2017/08/23 11:46:00 UTC

[jira] [Comment Edited] (PHOENIX-2048) change to_char() function to use HALF_UP rounding mode

    [ https://issues.apache.org/jira/browse/PHOENIX-2048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16136845#comment-16136845 ] 

Csaba Skrabak edited comment on PHOENIX-2048 at 8/23/17 11:45 AM:
------------------------------------------------------------------

Help, @hadoopqa lies:
* phoenix-core/src/it/java/org/apache/phoenix/end2end/ToCharFunctionIT.java _is_ a test and modification of it is included.
* There is no Javadoc warning about the modified files in the linked txt.
* Jenkins reported, Test Result (no failures)
* Yes, I can break the long lines.


was (Author: cskrabak):
Help, @hadoopqa lies:
* phoenix-core/src/it/java/org/apache/phoenix/end2end/ToCharFunctionIT.java _is_ a test and modification of it is included.
* There is no Javadoc warning about the modified files in the linked txt.
* Yes, I can break the long lines.

> 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
>            Assignee: Csaba Skrabak
>            Priority: Minor
>             Fix For: 4.12.0
>
>         Attachments: PHOENIX-2048.patch, PHOENIX-2048_v2.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)