phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Csaba Skrabak (JIRA)" <>
Subject [jira] [Commented] (PHOENIX-2048) change to_char() function to use HALF_UP rounding mode
Date Wed, 01 Feb 2017 08:14:51 GMT


Csaba Skrabak commented on PHOENIX-2048:

[^phoenix-2048.patch] is the solution that always uses HALF_UP. It is an _incompatible_ change.
I don't know about the configurable ideas. Is there any example in Phoenix for a function
that behaves different ways depending on configuration?

> change to_char() function to use HALF_UP rounding mode
> ------------------------------------------------------
>                 Key: PHOENIX-2048
>                 URL:
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: verify
>            Reporter: Jonathan Leech
>            Priority: Minor
>             Fix For: 4.10.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

View raw message