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