JavaScript convertir la chaîne en 2 décimales
var twoPlacedFloat = parseFloat(yourString).toFixed(2)
Worried Wombat
var twoPlacedFloat = parseFloat(yourString).toFixed(2)
var example = 3.35464464374256 ;
example = parseFloat(example.toFixed(2)) ; // example == 3.35
let example = 3.35464464374256;
example = Math.round(example * 10) / 10
var discount = Math.round((100 - (price / listprice) * 100) * 100) / 100;