Pages
Standard Library
Search
Entities
Number
Functions
Formats the given number using the given prefix and separating the digits by 3 with a comma.
Number.format("$ ", 1034150) == "$ 1,034,150"
Tries to parse the given string into a number.
Number.fromString("asd") == Maybe.nothing()
Number.fromString("012") == Maybe.just(12)
Returns true if given number is even.
Number.isEven(1) == true
Number.isEven(2) == false
Returns true if given number is NaN
.
Number.isNaN(`NaN`) == true
Number.isNaN(0) == false
Returns true if given number is odd.
Number.isOdd(1) == false
Number.isOdd(2) == true
Formats a number using fixed-point notation.
The first arguments specifies the number of digits to appear after the decimal point, it can be between 0 and 20.
Number.toFixed(2, 0.1234567) == "0.12"
Returns the string representation of the given number.
Number.toString(123) == 123