Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decimal without leading zero #39

Open
rmdort opened this issue May 13, 2021 · 1 comment
Open

Decimal without leading zero #39

rmdort opened this issue May 13, 2021 · 1 comment

Comments

@rmdort
Copy link
Contributor

rmdort commented May 13, 2021

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

Is this an issue with the parser?

@rmdort
Copy link
Contributor Author

rmdort commented May 18, 2021

I solved this by forcing a regex check :P

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant