Description Usage Arguments Value Examples
roundToBase
rounds value to nearest base.
1 | roundToBase(x, base, direction)
|
x |
An integer to be rounded |
base |
An integer base value |
direction |
A character value specifying the rounding directions (can be either 'up' or 'down') |
An integer rounded to the nearest base value
1 2 3 4 | roundToBase(17, 2, 'up') # would give 18
roundToBase(17, 10, 'up') # would give 20
roundToBase(17, 10, 'down') # would give 10
roundToBase(-17, 10, 'down') # would give -20
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.