Friday 23 December 2016

Round number up in JavaScript

I have the following number



0.135


I'd like to round it to 2 decimal places, I'm using...




(newCostDiff/2).toFixed(2)


only this returns



0.13


Can anyvody advise me on how to do this?

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...