Spread Sheet cell values setting to junk text if we enter values with commas

Hi @Natalia_Shilova @NatashaS
If I enter commas in webix spread sheet cells it is converting values to data implicitly. I want a way/option to disable auto convertion and want to enter numeric values with commas. Is there a way to do so.

webix.ui({
 	view:"spreadsheet",
    toolbar:"full",
    data:spreadsheet_data,
    id: "ss"
});
$$("ss").setCellValue(3,3,"1,000")

Thank you.

Hello @Harshvardhan_Gaddam ,

Such behaviour is expected for a Spreadsheet: similar to Excel, we store dates and time as numbers and the inner logic assumes symbols like " ", ".", ":", "-", ":", "," to be date separators. So when entering a value like “1,000” it is automatically converted to a date format ( or a number like 36525 ).

To avoid conversion to dates, you could use a Text format for your cells: Code Snippet .
To make the same dynamically, you can use onBeforeValueChange() method and perform some checks ( regEx ) on the entered values / other conditions and set the desired format: Code Snippet .
However, please, note that “string” expressions will not be calculated as numbers, e.g. “=1+2” won’t be equal to 3.

1 Like

Thanks a lot
This helped resolve the issue

Hello, as a follow-up, if you or somebody else still need to save math calculations in some way, we can suggest you to use this variant as well: Code Snippet .

As now entered values are of the number ( “int” ) format, we can enter values like 1,3 ( e.g. in A10 cell ) or 2,77 ( A11 ) and get the right result in the cell with a formula like =A10+A11 ( 4,07 ), which is not working when using a “string” format.