In this chapter, we will discuss numbers and string methods in TypeScript with examples.
TypeScript also carries numeric values as Number objects like JavaScript. A number object changes numeric value precisely to an example of the number class. The Number class acts as a wrapper. It allows the controlling of numeric exactly as they were objects.
Syntax 
var var_name = new Number(value)
 In case a non-numeric logic is passed as logic to the Number’s constructor, it returns NaN (Not–a–Number)
The following table shows a set of properties of the Number object.
S.No. Property & Description 1. MAX_VALUE 2. MIN_VALUE 3. NaN 4. NEGATIVE_INFINITY 5. POSITIVE_INFINITY 6. prototype 7. constructor 
Example 
console.log("TypeScript Number Properties: "); 
console.log("Maximum value that a number variable can hold: " + Number.MAX_VALUE); 
console.log("The least value that a number variable can hold: " + Number.MIN_VALUE); 
console.log("Value of Negative Infinity: " + Number.NEGATIVE_INFINITY); 
console.log("Value of Negative Infinity:" + Number.POSITIVE_INFINITY);
 It shows the same code in JavaScript on composing.
Its output is as follows.
TypeScript Number Properties:  
Maximum value that a number variable can hold: 1.7976931348623157e+308 
The least value that a number variable can hold: 5e-324 
Value of Negative Infinity: -Infinity 
Value of Negative Infinity: Infinity
 Example: NaN 
var month = 0 
if( month<=0 || month >12) { 
   month = Number.NaN 
   console.log("Month is "+ month) 
} else { 
   console.log("Value Accepted..") 
}
 It shows the same code in JavaScript on composing.
Its output is as follows. 
Example: prototype 
function employee(id:number,name:string) { 
   this.id = id 
   this.name = name 
} 
var emp = new employee(123,"Smith") 
employee.prototype.email = "smith@abc.com" 
console.log("Employee 's Id: "+emp.id) 
console.log("Employee's name: "+emp.name) 
console.log("Employee's Email ID: "+emp.email)
 It shows the same code in JavaScript on composing.
//Generated by typescript 1.8.10
function employee(id, name) {
   this.id = id;
   this.name = name;
}
var emp = new employee(123, "Smith");
employee.prototype.email = "smith@abc.com";
console.log("Employee 's Id: " + emp.id);
console.log("Employee's name: " + emp.name);
console.log("Employee's Email ID: " + emp.email);
 Its output is as follows.
Employee's Id: 123 
Employee's name: Smith 
Employee's Email ID: smith@abc.com
 Number Methods 
The Number object has only the default methods that are a part of every object’s definition. Some of the commonly used methods are shown below.
S.No. Methods & Description 1. toExponential() 2. toFixed() 3. toLocaleString() 4. toPrecision()  5. toString() 6. valueOf()