Skip to content
Advertisement

Is their any way I can **not** round off the number while using parseInt?

JavaScript

when I don’t use parseInt:

JavaScript

I need the array item’s as an number with decimal rather than a string.

Advertisement

Answer

parseInt converts to Integer. You want parseFloat :

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement