Since the example in the questions asks for a result of 1724.11
instead of 1724.1
I would assume you don't strictly want round
, but rather ceil
:
var n = 1724.10000000001;
Math.ceil(n * 100) / 100; // >> 1724.11
If a simple round up to the second decimal is required us Math.round
instead of Math.ceil
.