toFixedFix = function (n, prec) {
                    var k = Math.pow(10, prec);
                    return '' + Math.round(n * k) / k;
                }
Adapted from: http://phpjs.org/functions/number_format:481