fast-formula-parser icon indicating copy to clipboard operation
fast-formula-parser copied to clipboard

Decimal without leading zero

Open rmdort opened this issue 3 years ago • 1 comments

50*.85 throws an error while 50*0.85 works.

Is this an issue with the parser?

rmdort avatar May 13 '21 02:05 rmdort

I solved this by forcing a regex check :P

const regex = /([^\d|a-z])\.(\d+)/g; 
return text.replace(regex, "$10.$2");

rmdort avatar May 18 '21 08:05 rmdort