Skip to content

Can't parse NaN #537

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

Closed
ajf2 opened this issue Oct 29, 2018 · 1 comment
Closed

Can't parse NaN #537

ajf2 opened this issue Oct 29, 2018 · 1 comment

Comments

@ajf2
Copy link

ajf2 commented Oct 29, 2018

I have some very big numbers coming in from another system. For some reason, these can be larger than double.MaxValue and will come in as double.NaN. They're converted to string then sent to UnitsNet's Parse method, which fails throwing an exception: "Invalid string detected: a".

I think what should happen is that you get a length (or whatever) with a value of NaN.

I've written a test and made a change to the number regex which seems to pass the test. I'll make a pull request soon.

@angularsen
Copy link
Owner

Closed for same reason as PR #540 .

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

2 participants