Lets take two floating decimal numbers <1907.42> and <68.8>. If we multiply these values the result will be <131230.496>.
If u round using Math.round() then the result will be <131230.0>.
But in accounting procedures we take to 2 decimal points which make it <131230.50>
and then after rounding this we find <131231.0>
The solution for this:
Math.round(Math.rint((NUM1 *NUM2)* 100.0) / 100.0)
Comments