Skip to content

via-platform/num-plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

num-plus

num-plus is an extension of the num library by Roman Shtylman. It adds several additional functions for convenience.

Additional Functions

floor(precision)

Returns a copy of the number, rounded down to the nearest decimal, as specified by {precision}. Please note that numbers are always rounded down - this includes negative numbers. This functionality was designed to match the Math.floor() function.

num(1.2345).floor(3) => 1.234 num(-1.2345).floor(3) => -1.235

ceil(precision)

Returns a copy of the number, rounded up to the nearest decimal, as specified by {precision}. Please note that numbers are always rounded up - this includes negative numbers. This functionality was designed to match the Math.ceil() function.

num(1.2345).floor(3) => 1.235 num(-1.2345).floor(3) => -1.234

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published