Javascript round to nth decimal place
function round(value, decimals) { return Number(Math.round(value+'e'+decimals)+'e-'+decimals); }