Test System.Data.Tests.SqlTypes.SqlDoubleTest.Conversions fails on non english culture
See original GitHub issueThe test is failing on this line (and I believe this will be the same).
Failing message is:
Assert.Equal() Failure Expected: 6.4E+65 Actual: 6,4E+65
The value is the same, but notice the difference in decimal separator. My Windows’ culture is Slovak and we have comma as a decimal separator. The method of SqlDouble.ToString()
and its conversion to SqlString
is done without specifying the culture, so it uses the system’s one, hence the difference.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
SQL Server Data Type Conversion Methods and ...
This artcile explores the SQL Server Data type conversion method and their performance comparison.
Read more >What is A/B Testing? A Practical Guide With Examples
A/B testing (also called split testing) is comparing two versions of a web page to figure out the better performing variation. Learn more...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think this should have been moved to the dotnet/runtime repo, but it seems that the issue does not exist there anymore. https://github.com/dotnet/runtime/blob/6072e4d3a7a2a1493f514cdf4be75a3d56580e84/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlDoubleTest.cs#L274 They are now using ToString on a double literal instead of using a string literal, this will ensure that the string has the correct format for the local culture.
So I think this case can just be closed.
Great, thanks @initram !