rounding in base 10
问题 I have a function to round a number given to the function to the nearest whole pence. <script type='text/javascript'> Math.roundNumber = function(a,b){ if(!isNaN(parseInt(a))){ c = Math.pow(10,b); return (Math.round(a*c)/c); } return false; } </script> however it has come to my attention that the said number inputted into the function must only be rounded up to the nearest one pence however it must be rounded to two decimal places. E.G. 15.236562213541684 would = 15.24 9846.65456169846 would