Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
Both methods will convert number to string, where .toExponential() will return exponential notation and .toFixed() will return string with specified number of decimal places (the default is 0); so, if you say 3.33764.toFixed(2) it will return '3.33'
22nd Jun 2016, 1:33 PM
Axle