var var_name = new Number(value)
- NaN: This property has Equal to a value that is not a number.
- NEGATIVE_INFINITY: This has a value that is less than MIN_VALUE.
- POSITIVE_INFINITY: This has a value that is greater than MAX_VALUE.
- prototype: This property is used to assign new properties and methods to the Number object.
- constructor: This property will return the function that created this object’s instance
Number Properties in TypeScript: Maximum value of a number variable has: 1.7976931348623157e+308 The least value of a number variable has: 5e-324 Value of Negative Infinity: -Infinity Value of Negative Infinity:Infinity
Example of NaN:
Month is NaN
- toExponential(): This method will return a number to display in exponential notation.
- toFixed(): This method will stable the number to the right of the decimal with a specific number of digits.
- toLocaleString(): This method is used to convert the number into a local specific representation of the number.
- toPrecision(): It will define total digits to the left and right of the decimal to display of a number. It will also show an error when there is negative precision.
- toString(): Used to return the string representation of the number in the specified base.
- valueOf(): This method will return number’s primitive value.
num3.toFixed() is 237 num3.toFixed(2) is 237.134 num3.toFixed(6) is 237.13400
5.7645326 5 5.7
10 1010 12
- Identifiers and Keywords in TypeScript
- Data types in TypeScript
- Hello World in TypeScript
- Variables in TypeScript
- TypeScript class
- Classes in TypeScript
- TypeScript Arrays
- TypeScript Tuples
- TypeScript Ambients Declaration
- TypeScript Union
- TypeScript String
- TypeScript Accessor
- Why use Question mark in TypeScript variable ?
- What are the differences between any vs Object in TypeScript?
- How to execute TypeScript file using command line?
- What is the difference between interface and type in TypeScript ?
- How to Import another TypeScript Files ?
- Difference between private keyword and private fields in TypeScript
- What is the difference between 'String' and 'string' in TypeScript ?