-
Notifications
You must be signed in to change notification settings - Fork 184
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
Yahoo and Stooq importer tests are failing #5
Comments
@Wind-rider Thanks! I will re-check that. Main branch or which one? Can you just tell me your Culture? I'm asking this because I detected some test where failing for es-XX (Spanish, we use inverted , and . in numbers) and I fixed some of the tests but not all. Thanks! Fer |
Main branch, culture is probably nl-nl. I don't know how the parsing is done now, but I assume that the culture should not influence the parsing. |
Hi @Wind-rider . Just do a single test with a decimal.Parse("3.456") in Argentina where we use comma for decimal separations and that will return 3456m while if you do it in United States (just to give an example) it will return 3.456m. Looks like both Yahoo Finance API library and StooqAPI library are using the CultureInfo.CurrentCulture. If you want those libraries to work you need to the set the culture. I just make a commit to proves that. We will see if we fix it or we leave that way and the user set the culture as they need as for users who have machines configured with the '.' as decimal separation they don't see that issue. I mean, I can't decide as @lppkarl actually has access or had written code in those libraries and maybe he is able to quickly fix them. You may check to see Nuba.Finance.Google and the importer that is being done by @lppkarl . That library shouldn't be getting that kind of exceptions as the library itself use its own Culture for parsing. Hope this help till we see if we implement a tricky solution for each call to those importers. |
That is exactly what I meant - a parser should do its work independent from the computer it runs on (CurrentCulture). So the parser should either use InvariantCulture or stick to a specific culture. |
The Yahoo API (and other APIs) always responds in the same way, so the user shouldn't be required to set a culture for it. |
@Wind-rider yea you're right. I'm missing the InvariantCulture there, will be adding to it soon, thanks :) |
The ImportByYahoo and ImportByStooq tests are failing, probably because the decimal point gets lost somewhere
The text was updated successfully, but these errors were encountered: