[
https://issues.apache.org/jira/browse/SPARK-14639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Davies Liu updated SPARK-14639:
-------------------------------
Assignee: Dongjoon Hyun
> Add `bround` function in Python/R.
> ----------------------------------
>
> Key: SPARK-14639
> URL: https://issues.apache.org/jira/browse/SPARK-14639
> Project: Spark
> Issue Type: Improvement
> Components: PySpark, SparkR
> Reporter: Dongjoon Hyun
> Assignee: Dongjoon Hyun
> Fix For: 2.0.0
>
>
> This issue aims to expose Scala `bround` function in Python/R API.
> `bround` function is implemented in SPARK-14614 by extending current `round`
> function.
> We used the following semantics from
> [Hive|https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/RoundUtils.java].
> {code}
> public static double bround(double input, int scale) {
> if (Double.isNaN(input) || Double.isInfinite(input)) {
> return input;
> }
> return BigDecimal.valueOf(input).setScale(scale,
> RoundingMode.HALF_EVEN).doubleValue();
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]