ce
ce copied to clipboard
Mask problems with negative sign
Hi guys,
Thanks for this great lib!!! There is a issue in the formulas when using a negative sign in a currency mask without RED.
Ex.: https://bossanova.uk/jspreadsheet/v4/examples/column-types { type: 'numeric', title:'Price', width:100, mask:'$ #.##,00', decimal:',' },
If you insert a negative value in any cell of "Price column" and try to calculate it in other cell, It will return a NaN value. Like this:
I inserted a new column (G) after the price column and calculeted "price value / 2" : G1 value = -F1/2 G2 value = -F2/2

The issue is in the "parseNumber" function that doesn't accept a negative number as a valid number. The fix is in line that checked if number[0] is a valid number:
If the Jspreadsheet's developers prefer, I can send a pull request. Regards,
Marcos
Hi,
I think you can send a pull request 😊
Thanks
Hi @GBonnaire,
I just did it. Sorry for the long time this took. Merry Christmas!