What would be the most elegant way to round a float by 2 decimal places always up in javascript?
Ex: 2.453 = 2.46
What would be the most elegant way to round a float by 2 decimal places always up in javascript?
Ex: 2.453 = 2.46
Try this:
Math.round(num * 100) / 100
Source: link
Or in your case, do something like:
var arrendondar = Math.round(num * 100);
var resultado = Math.ceil(arredondar)/100;