function my_round(number,n) { var kof = Math.pow(10, n); return Math.round(number*kof)/kof; } trace(my_round(10.198767843,3));