Following lines are for rounding a number to specified decimal places.
function roundNumber(num, dec)
{
var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
return result;
}
Above javascript function can be implement as follows
var roundedNumber = roundNumber(annualPremium,2);
No comments:
Post a Comment