Forum Discussion

Kclark1017's avatar
Kclark1017
Copper Contributor
Mar 11, 2022

Round Function Bug

For instance, if the function =ROUND(E11-E12,2) is rounding incorrectly when E11 and E12 are 49.995 & 49.2 respectively. I noticed its also incorrect for 39 and 59. All other values seem to round correctly. Anything you notice here? Or is this an actual bug? It does work if I round to 3 decimals then round to two but I should not have to do that.

2 Replies

  • JMB17's avatar
    JMB17
    Bronze Contributor
    As Riny mentioned, it's floating point error. You could try rounding the inputs instead of rounding the result:

    =ROUND(E11,2)-ROUND(E12,2)
  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Kclark1017 That is called a "floating point error". Google for that phrase and you can learn all about it. Increase the number of decimals like in the picture below and you'll see that 49.995 minus 49.2 is not resulting in the 0.795 that you expect.

Resources