Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 8
    @AustinHenley I tried using round() and it didn't work. That's probably why people are down voting. He may be refering to Math.round() Commented Dec 21, 2012 at 22:51
  • @Nathan it needs to be used inline, after parseFloat() as I've updated the answer by @zsalzbank Commented Jun 1, 2013 at 12:34
  • 3
    No, it doesn't work. You may try Math.round(parseFloat(yourString), 2); Commented Jul 17, 2014 at 21:23
  • 1
    Why not downvote an answer which will never work? There's simply no such method as round() on numbers in js. The real question is who upvoted this. Commented Nov 25, 2016 at 7:09