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

Floating point type parameters parsing problem #63

Closed
RuslanMarchenko opened this issue Feb 3, 2015 · 4 comments
Closed

Floating point type parameters parsing problem #63

RuslanMarchenko opened this issue Feb 3, 2015 · 4 comments
Assignees
Milestone

Comments

@RuslanMarchenko
Copy link

When I call odata function with a double parameter, I can see that ExpressionLexer.MakeBestGuessOnNoSuffixStr method is using current thread culture for several TryParse method calls when trying to parse the parameter from the url. I suppose that to be a bug because the numeric literal format is fixed in OData-ABNF, the double one for example. It seems that there is a need to call TryParse with invariant culture, insn’t it?

@congysu
Copy link
Contributor

congysu commented Feb 17, 2015

@Ruslan: Would you like to contribute a fix for the issue? Thanks.

@cisnetsov
Copy link

Same problem. Any update?

@maximpashuk
Copy link
Contributor

If CurrentCulture is russian (for example), then double.Parse("0.23") will fail and double.Parse("0,23") will success - used comma instead of dot.
Because ABNF for ODATA resticted to dots, so ExpressionLexer should use InvariantCulture then parsing strings.
I made in in my pull request #374

lewischeng-ms pushed a commit to lewischeng-ms/odata.net that referenced this issue Nov 13, 2015
@lewischeng-ms
Copy link
Contributor

PR #374 has been merged. @maximpashuk Thanks for your contribution again!

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

7 participants