round_up: Round up from 5

Description Usage Arguments Value Source References See Also Examples

Description

R's base::round() function rounds to even, this rounds always up from 5.

Usage

1
round_up(x, n = 0)

Arguments

x

Numbers to round.

n

Number of digits to round to.

Value

Rounded number.

Source

https://stackoverflow.com/questions/12688717/round-up-from-5

References

http://theobligatescientist.blogspot.de/2010/02/r-i-still-love-you-but-i-hate-your.html

See Also

Other rounding functions: mpformat, oom

Examples

1
2
3
x <- 1234.5
round(x) # 1234
round_up(x) # 1235

tamaracha/mpformatr documentation built on May 8, 2019, 3:14 a.m.