Have ideas to improve npm?Join in the discussion! »

@extra-number/ceilTypeScript icon, indicating that this package has built-in type declarations

2.0.27 • Public • Published

Rounds up number to specific precision.

This is part of package extra-number.

number.ceil(n, pre);
// n:   a number
// pre: to precision
const number = require('extra-number');

number.ceil(9.121, 1);
// 10

number.ceil(9.121, 0.01);
// 9.13

number.ceil(9.1217, 0.05);
// 9.15

references

Install

npm i @extra-number/ceil

DownloadsWeekly Downloads

13

Version

2.0.27

License

MIT

Unpacked Size

2.57 kB

Total Files

9

Last publish

Collaborators

  • avatar