function round(num, precision) {
precision = Math.pow(10, precision)
return Math.ceil(num * precision) / precision
}
console.log(round(199.178, 1));
console.log(round(199.178, 2));
console.log(round(199.178, 3));
console.log(round(199.978, 1));
console.log(round(199.978, 2));
console.log(round(199.978, 3));
/*
run:
199.2
199.18
199.178
200
199.98
199.978
*/