Number

new Number() Number(`value`

)`value`

With the `new`

operator, the
`Number( )`

constructor converts its
argument to a numeric value and returns a new Number object wrapped
around that value. Without `new`

,
`Number( )`

is a conversion function
that converts its argument to a number and returns that value.

These constants are properties of `Number`

itself, not of individual Number
objects.

`Number.MAX_VALUE`

The largest representable number. Approximately 1.79E+308.

`Number.MIN_VALUE`

The smallest representable positive number. Approximately 5E-324.

`Number.NaN`

Not-a-number value. Same as the global

`NaN`

.`Number.NEGATIVE_INFINITY`

Negative infinite value.

`Number.POSITIVE_INFINITY`

Infinite value. Same as global

`Infinity`

.

`toExponential(`

`digits`

`)`

Returns a string representation of the number, in exponential notation, with one digit before the decimal place and

digits after the decimal place. The fractional part of the number is rounded, or padded with zeros so that it has the specified length.`digits`

must be between 0 and 20, and if omitted, as many digits as necessary are used. JS 1.5; JScript 5.5; ECMA v3.`digits`

`toFixed(`

`digits`

`)`

Returns a string representation of the number that does not use exponential notation, and has exactly

digits after the decimal place.`digits`

must be between 0 and 20. The number is rounded or padded with zeros if necessary. JS 1.5; JScript 5.5; ECMA v3.`digits`

`toLocaleString( )`

Returns an implementation-dependent string representation of the number, formatted according ...

Start Free Trial

No credit card required