arrondi javascript 2 decimal code example
Example 1: js number 2 decimal places
(3.141596).toFixed(2); // 3.14
Example 2: arrondi js
let x = 2.960024578;
let res = x.toFixed(2);
console.log(res);
//2,96
Example 3: javascript 2 decimal float array elements
var x = 0;
var len = my_array.length
while(x < len){
my_array[x] = my_array[x].toFixed(2);
x++
}