﻿
function round(x, n)
{
    var d = Math.pow(10, n );
    var tmp = x * d;
    tmp = Math.round(tmp);
    return tmp / d;
}