parse-community / Parse-SDK-dotNET

Parse SDK for .NET, Xamarin, Unity.
http://parseplatform.org
Apache License 2.0
323 stars 261 forks source link

Use invariant device locale for number format conversion #308

Closed TobiasPott closed 5 years ago

TobiasPott commented 5 years ago

This PR adds invariant culture to the conversion methods used in Parse. It prevents conversion based on a device's locale (e.g. french or german) to error on numbers encoded with invariant/US locale (which uses . instead of , as decimal delimiter).

In addition a test method is added (to check this method on the developers machine locale) The test might be extended to explicitly use non-invariant locales for testing (e.g. german or french) to allow it to properly work on machines not using those locales by default. I'm not quite sure on what basis I should pick those locales to test again, except for those two I know of which caused the error described in issue #305. (Feedback is appreciated on this one)

This pull request handles issue #305

codecov[bot] commented 5 years ago

Codecov Report

Merging #308 into master will decrease coverage by 0.31%. The diff coverage is 40%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #308      +/-   ##
==========================================
- Coverage   59.09%   58.77%   -0.32%     
==========================================
  Files          91       91              
  Lines        6126     6128       +2     
==========================================
- Hits         3620     3602      -18     
- Misses       2506     2526      +20
Impacted Files Coverage Δ
Parse/Internal/ParseCorePlugins.cs 85.31% <ø> (ø) :arrow_up:
Parse/Public/ParseObject.cs 64.95% <0%> (-0.16%) :arrow_down:
Parse/Public/ParseClient.cs 74.07% <0%> (ø) :arrow_up:
Parse/Public/Utilities/Conversion.cs 100% <100%> (ø) :arrow_up:
Parse/Internal/Utilities/ParseUserExtensions.cs 28.57% <0%> (-42.86%) :arrow_down:
Parse/Internal/Utilities/ParseQueryExtensions.cs 33.33% <0%> (-33.34%) :arrow_down:
Parse/Internal/Utilities/ParseObjectExtensions.cs 50% <0%> (-25%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d0577f4...36ef6b0. Read the comment docs.