Calc: Formula Result Should Display Zero

I’m doing a quick rec between some invoices and payments I have made and the total that comes back is -4.9960e-014 which I realise is a tiny number however why doesn’t it just display 0 as it’s very confusing.

The numbers are: 126.24, 152.66, 108.90, 104.92, -494.54, 1.82

If you sum that you get the result above and not 0 as I would expect to see.

Why does it do that?

Using on Ubuntu 15.04 and it does the same thing in Windows 7 Ultimate on LO

I get the same answer. I believe it occurs because the decimal number is converted to binary, the math is applied, then it is converted back to decimal. Because of significant digits (max # of digits is 15) accuracy is lost beyond 15 digits. if you type in a number like 12345667890.12345678, only 15 of the digits will be shown regardless of where the decimal is positioned.

To reduce odd calculations from occurring, you can use “Precision as Shown” check box or use the Rounding features.

The setting is under Tools, Options, LibreOffice Calc, Calculations, Precision as Shown.

You’ll want to do some research on the effects of using this setting.

Thanks I’ll take a look at the precision as shown option however rounding worked fine in this instance so I’ll probably just stick to that when I notice odd results in future and explore that other option if rounding doesn’t seem to do what I need it to do.