Description Usage Arguments Details Value Functions Examples
View source: R/number_functions.R
Functions to round a number to to the nearest base using either nearest value, ceiling or floor methods
1 2 3 4 5 | round_nearest(x, base)
round_up(x, base)
round_down(x, base)
|
x |
A number/vector to round, can be integer or float |
base |
A base to round to, can be integer or float |
Round a number to the nearest base, e.g, round a number to the nearest 500 or 45
A numeric value or a vector of round numeric values.
round_up
: Round a number up to the nearest specified base
round_down
: Round a number down to the nearest specified base
1 2 3 4 5 6 7 8 | round_nearest(350, 500)
[1] 500
round_nearest(19.4, 10.1)
[1] 20.2
round_up(350, 500)
[1] 500
round_down(350, 500)
[1] 0
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.