showing results for - "redondear decimales javascript"
Miguel
07 Nov 2019
1console.log(Math.round(0.9));
2// expected output: 1
3
4console.log(Math.round(5.95), Math.round(5.5), Math.round(5.05));
5// expected output: 6 6 5
6
7console.log(Math.round(-5.05), Math.round(-5.5), Math.round(-5.95));
8// expected output: -5 -5 -6