Try the following function, in my case it was the option that worked for me:
Number.prototype.roundDecimal = function (d) {
if (!d || d == 0 || d == null || typeof d === 'undefined') { d = 2; };
num = this;
num = num * Math.pow(10, d)
num = Math.round(num)
num = num / Math.pow(10, d)
return num
}
Then you only use the function something like this:
var num = 99.92+0.04;
num = num.roundDecimal() //Si no le pasas parametro toma 2 decimales despues del punto.
This has worked for me in a billing application (decimals management) that I currently have in production.
It's an adaptation of this code .