javascript numbers properties

1parseFloat()

parseFloat is a javascript number properti. it can convert a string to integer. if you have a number in a string, you can convert the number from string to integer by using parseFloat().

var age =“20 years”;

document.write(parseInt(age));

UI : 20;

2toFixed()

toFixed is a method it have a internal power to fixed a number, for example user give you this(25.124586) . but you want only two number after the point.

example

const price= 12.666666

console.log(price.toFixed(2))

now you can get ; 12.66

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store