test.js 81 Bytes EditWeb IDE 1 2 3 4 5 6 7 8 9 10 11 let num = 23.1 console.log( Math.round(num.toFixed(4)*1000)/1000 - 0 );