Skip to content

roundAwayFromZero

Module Export

number |> number => number

Rounds a number to the given decimal.

Remarks

Note that midpoints are rounded away from zero. In other to round using “Bankers Rounding”, e.g. midpoints are rounded to nearest event number, see round.

Examples

import 'math'
from 3.3333 roundAwayFromZero 2
// Returns:
3.33