JS Useful References
JS Useful Resources
© 2013 TutorialsPoint.COM
The Number object represents numerical date, either integers or floating-point numbers. In general, you do not need to worry about Number objects because the browser automatically converts number literals to instances of the number class.
Creating a number object:
var val = new Number(number);
If the argument cannot be converted into a number, it returns NaN (Not-a-Number).
Here is a list of each property and its description.
|NaN||Equal to a value that is not a number.|
|NEGATIVE_INFINITY||A value that is less than MIN_VALUE.|
|POSITIVE_INFINITY||A value that is greater than MAX_VALUE|
|prototype||A static property of the Number object. Use the prototype property to assign new properties and methods to the Number object in the current document|
The Number object contains only the default methods that are part of every object's definition.
|constructor()||Returns the function that created this object's instance. By default this is the Number object.|
|toFixed()||Formats a number with a specific number of digits to the right of the decimal.|
|toLocaleString()||Returns a string value version of the current number in a format that may vary according to a browser's locale settings.|
|toPrecision()||Defines how many total digits (including digits to the left and right of the decimal) to display of a number.|
|toString()||Returns the string representation of the number's value.|
|valueOf()||Returns the number's value.|