Numbers
Introduction
JavaScript has only one type of number. Numbers can be written with or without decimals.
var x = 3.14; // A number with decimals
var y = 3; // A number without decimals
Number Methods
toString()This method is used to return the given number as string.
toExponential()This method round the given number and writes with exponential format.
var MeshSize = 9.656;
MeshSize.toExponential(2); // returns 9.66e+0
MeshSize.toExponential(4); // returns 9.6560e+0
MeshSize.toExponential(6); // returns 9.656000e+0
Returns a string and the number written with a specified number of decimals.
var LayerThickenss= 9.656;
LayerThickenss.toFixed(0); // returns 10
LayerThickenss.toFixed(2); // returns 9.66