Sunday 19 November 2017

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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...