Skip to main content

Round to a step

Round a number to the nearest step, e.g. prices to 0.05 or 0.99 endings, times to 15 minutes, quantities to a pack size.

Command in the Number toolkit · id ooa.number/round_to_step · 3 inputs (1 required), 1 output

Inputs​

InputTypeRequiredDefaultWhat it is
ValueNumberYesNumber to round.
StepNumberNo0.05The step, e.g. 0.05, 0.5, 10 or 12 (a pack of twelve).
DirectionStringNonearestTo the nearest step (halves go up), always up, or always down.

Outputs​

OutputTypeWhat it is
resultNumberThe rounded number.