Problema with decimal number in handsontable

Tags: #<Tag:0x00007efc620eb0e0>

When I add a number with more than one decimal place, the returned value is incorrect.

Example: =5.5+14.01
Should be: 19.51
But it is shown: 19.509999999999998

Is there a way to fix it?

My version: 6.2.2 (But it is reproducible in version 8.1 demo)

Hi @nathalia.pissuti

I recommend setting up a numericFormat for the formula cells. Here https://jsfiddle.net/AMBudnik/wpnxz801/ is an example where I use

 numericFormat: {
        pattern: '0,0.00'
}

(lines 11-13) so my whole first column has the same format.
Do you wish to have the same format across all the numeric values in the table, Nathalia?

Hi, thank you for answer me!
In your example, when I type the formula in the cell it gives the same error, although it doesn’t happen with the formula that was already there at startup

I do not see any error on my device (macOS Catalina / Chrome 86).

This is how the table appears on my device

54

and there are no console errors.

Did you try to type the formula in a cell that is empty, after the spreadsheet was already loaded?
I’m using macOS Catalina 10.15.7 / Chrome 86
When I type a new formula it looks like this to me:
image

A gif with the error:
https://drive.google.com/file/d/1_4mdkvex5AQyCvhU356xSzOfojROeru5/view?usp=sharing

The numeric formatting has been added only to the first column. Here https://jsfiddle.net/AMBudnik/y68k3mgn/ it is added to the whole table.

1 Like

Thank you!