Skip to content
Subhajit Sahu edited this page Aug 8, 2022 · 1 revision

Round up a number to specific precision.

Similar: floor, ceil, round.


function ceil(x, pre?)
// x:   a number
// pre: to precision [1]

const xmath = require('extra-math');


xmath.ceil(9.121, 1);
// → 10

xmath.ceil(9.121, 0.01);
// → 9.13

xmath.ceil(9.1217, 0.05);
// → 9.15


References

Clone this wiki locally