jeudi 13 août 2015

How to obtain only the integer part of a long floating precision number with JS?

I know there's

  • Math.floor
  • parseInt

But about this case:

Math.floor(1.99999999999999999999999999)

returning 2, how could I obtain only its integer part, equals to 1?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire