function round(num, precision) {
precision = Math.pow(10, precision)
return Math.ceil(num * precision) / precision
}
console.log(round(189.178, 1));
console.log(round(189.178, 2));
console.log(round(189.178, 3));
console.log(round(189.978, 1));
console.log(round(189.978, 2));
console.log(round(189.978, 3));
/*
run:
189.2
189.18
189.178
190
189.98
189.978
*/