[
https://issues.apache.org/jira/browse/PHOENIX-2048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15848596#comment-15848596
]
Jonathan Leech commented on PHOENIX-2048:
-----------------------------------------
Looking through the other functions, I don't see any that look at
configuration. Should be possible to grab a value from hbase-site.xml in a
function, not sure if it's necessary.
> 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.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
(v6.3.15#6346)