function strongRound(data) {
    for (var i = data.length; i-- > 0;) {
        if (data[i].toFixed(precision) != data[i]) {
            var rounded = +data[i].toFixed(precision - 1);
            data[i] = +Math.abs(rounded - data[i]).toFixed(precision + 1) >= error ?
                +data[i].toFixed(precision) :
                rounded;
        }
    }
    return data;
}
Decrease accuracy of floating-point numbers
in path data keeping a specified number of decimals.
Smart rounds values like 2.3491 to 2.35 instead of 2.349.
Doesn't apply "smartness" if the number precision fits already.

@param {Array} data input data array
@return {Array} output data array