Wednesday, June 30, 2021

TypeScript Data Type - Number Example | Demo

JavaScript, TypeScript supports number data type. All numbers are stored as floating point numbers. These numbers can be Decimal (base 10), Hexadecimal (base 16) or Octal (base 8);

Numbers Method


Method Description
toExponential() Returns the exponential notation in string format.
toFixed() Returns the fixed-point notation in string format.
toLocaleString() Converts the number into a local specific representation of the number.
toPrecision() Returns the string representation in exponential or fixed-point to the specified precision.
toString() Returns the string representation of the number in the specified base.
valueOf() Returns the primitive value of the number.



Data Type Demo




No comments:

Post a Comment

How to build an Express and Node.js app with Typescript

  In this tutorial, you will learn how to set up a Node.js and Express project with Typescript and live auto-reloading. Note that this metho...