-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
  • 204,283
  • 31
  • 260
  • 272
Eldho NewAge
  • 1,313
  • 3
  • 13
  • 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