Description Usage Arguments Note Examples
Round x up or down to the nearest multiple of n.
1 2 3 4 5 | round_to_next_multiple(x, n)
ceiling_to_next_multiple(x, n)
floor_to_next_multiple(x, n)
|
x |
The value to round. |
n |
The value which determines the rounding target. |
Symmetrical rounding to the next power of ten can also be archived
using round
with a negative digits
argument.
1 2 3 4 | round_to_next_multiple(120, 50) # 100
round_to_next_multiple(17, 5) # 15
floor_to_next_multiple(195, 100) # 100
ceiling_to_next_multiple(10.3, 2) # 12
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.