If you are using 840.5, Excel will automatically round the number, so click on the cell and make sure it says 840.5 in the Value Bar at the top (or by double clicking in the cell).
If the value says 841, then you must be rounding it when you write the cell. If this is the case, make sure you are not using any functions that would round it like Round() or CInt(); maybe even check the value before the Write Cell to make sure it wasn’t rounded.
—the first point I made about Excel rounding it is more likely
Image is not visible to us.
Could you please upload it again?
or
you can do below,
go to excel and click on that yellow icon below screenshot shows that and choose Convert to Number
Can you verify before the Write Cell that MONTANT.Replace(",",".") = 840.5 ?
Also side note, you don’t need to convert it to a Double like you are doing. You only need to convert it to double to format the number or use it for math and number comparisons.
Cool.
Can you open the Excel file and verify the cell does not have the cell formatted with zero decimal places by right clicking and choosing Format Cell? Or also check the value by looking in the top Bar or by double clicking the cell.