In JavaScript, you want to limit the value of a number without qualifying it as an integer or floating-point type
var num1 = n; var num2 = 55.51; var num3 = -34; var num4 = 9e5; + "+ num2 +" "+ num3 +" "+ num4); //
The toexponential () function is displayed in a way that converts a numeric value to science and technology, for example:
document.write (num2.toexponential (9)); // Output 5.551000000e+1
Object properties and Object methods for W3cschool values
Number object property
Properties |
Description |
Constructor |
Returns a reference to the number function that created this object. |
Max_value |
The maximum number that can be represented. |
Min_value |
The smallest number that can be represented. |
NaN |
Non-numeric value. |
Negative_infinity |
Negative infinity, which returns this value when overflow. |
Positive_infinity |
Positive infinity, which returns this value when overflow. |
Prototype |
gives you the ability to add properties and methods to an object. |
Number Object method
Method |
Description |
Tostring |
Converts a number to a string, using the specified cardinality. |
toLocaleString |
Converts a number to a string, using the local number format order. |
ToFixed |
Converts a number to a string, the result of which has a specified number of digits after the decimal point. |
Toexponential |
Converts the value of an object to an exponential count method. |
Toprecision |
Formats the number as the specified length. |
ValueOf |
Returns the base numeric value of a number object. |
JavaScript Basic Series (c) data type (numeric number)