O'Reilly logo

Learning Angular for .NET Developers by Rajesh Gunasundaram

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Number

The number data type holds floating-point values. Similar to JavaScript, TypeScript considers all numbers as floating-point values. Declaring and initializing the number data type variable can be done as follows:

let price: number = 101; 

Here, the price variable is declared as number and is assigned the value 101. Number type can hold values such as decimal, binary, hexadecimal, and octal literals, as shown:

let decimal: number = 6; let hex: number = 0xf00d; let binary: number = 0b1010; let octal: number = 0o744; 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required