-2

For Example,

0.14 instead of 0.1445436

9.94 instead of 9.94476

9.99 instead of 9.99996544

8.90 instead of 8.9

j08691
  • 197,815
  • 30
  • 248
  • 265
Eldho NewAge
  • 1,213
  • 1
  • 12
  • 17

1 Answers1

0
 n = 0.14
nDec = n.toFixed(2) 

You need to throw the toFixed() method at the number. The number in parens is the number of digits from teh decimal.

VikingBlooded
  • 884
  • 1
  • 6
  • 17