function precisionRoundMod(number, precision) { var factor = Math.pow(10, precision); var n = precision < 0 ? number : 0.01 / factor + number; return Math.round( n * factor) / factor; }
function precisionRoundMod(number, precision) { var factor = Math.pow(10, precision); var n = precision < 0 ? number : 0.01 / factor + number; return Math.round( n * factor) / factor; }