TypeScript Number


Example

Like JavaScript, numbers are floating point values.

let pi: number = 3.14;           // base 10 decimal by default
let hexadecimal: number = 0xFF;  // 255 in decimal

ECMAScript 2015 allows binary and octal.

let binary: number = 0b10;   // 2 in decimal
let octal: number = 0o755;   // 493 in decimal