bround

0th

Percentile

bround

Returns the value of the column e rounded to scale decimal places using HALF_EVEN rounding mode if scale >= 0 or at integer part when scale < 0. Also known as Gaussian rounding or bankers' rounding that rounds to the nearest even number. bround(2.5, 0) = 2, bround(3.5, 0) = 4.

Usage
bround(x, ...)

# S4 method for Column bround(x, scale = 0)

Arguments
x

Column to compute on.

...

further arguments to be passed to or from other methods.

scale

round to scale digits to the right of the decimal point when scale > 0, the nearest even number when scale = 0, and scale digits to the left of the decimal point when scale < 0.

Note

bround since 2.0.0

See Also

Other math_funcs: acos, asin, atan2, atan, bin, cbrt, ceil, conv, corr, cosh, cos, covar_pop, cov, expm1, exp, factorial, floor, hex, hypot, log10, log1p, log2, log, pmod, rint, round, shiftLeft, shiftRightUnsigned, shiftRight, signum, sinh, sin, sqrt, tanh, tan, toDegrees, toRadians, unhex

Aliases
  • bround
  • bround
  • bround,Column-method
Examples
# NOT RUN {
bround(df$c, 0)
# }
Documentation reproduced from package SparkR, version 2.1.2, License: Apache License (== 2.0)

Community examples

Looks like there are no examples yet.