Hi everyone!
I need help in probably something obvious. While creating new row i just need take value from cell above, and add to it 0.01. I thought just .setdataatcell will solve the problem, but i cannot make it.
"add_row": {
name: 'Add row',
callback: function(key, options) {
hot.alter('insert_row', hot.getSelectedLast()[0] + 1, 1);
for (var i = 0; i < columns.length - 1; i++) {
if(i===1){
hot.setDataAtCell(hot.getSelectedLast()[0] + 1, i, hot.getDataAtCell(hot.getSelectedLast()[0],i)+0.01);
}
else {
hot.setDataAtCell(hot.getSelectedLast()[0] + 1, i, hot.getDataAtCell(hot.getSelectedLast()[0],i));
}
}
}
},`
I have code like above, and i want to every first column, increase cell value with 0.01. But while it is not string its working like concat - (for example i have 1.00, adding 0.01 makes it 1.000.01) And when i have it as numeric cell type it is just not working. Any advice?