-
Notifications
You must be signed in to change notification settings - Fork 383
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
Fix deserializing decimal quantities regardless of local culture #911
Conversation
dac9477
to
d360827
Compare
Codecov Report
@@ Coverage Diff @@
## master #911 +/- ##
==========================================
- Coverage 82.70% 82.70% -0.01%
==========================================
Files 291 291
Lines 44040 44034 -6
==========================================
- Hits 36423 36417 -6
Misses 7617 7617
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the JSON specs the separator is indeed "." (InvariantCulture).
However, given that nobody has complained so far, I would suggest that for v5 we simply replace the Value
with the ExtendedValue
(i.e. the string representation of the number) and remove the ExtendedValueUnit
as it's CLR type could easily be determined from the Unit
(once parsed, we can check for the IDecimalQuantity
).
Great, yes, that sounds reasonable. As for v5, the wishlist is piling up and there are several big ideas for changes that are still up in the air; #714, #709, class vs struct. If you or @tmilnthorp want to start nudging the v5 snowball, I'm happy to help, but work and family has been pretty much consuming all life the past 9 months and it's likely to continue. Baby steps is probably a good idea if we are ever to get any of the breaking changes out the door. |
@lipchev forgot to mention you. ☝️ |
Fixes parsing JSON for decimal quantities like Power on machines with cultures like Norwegian, where a comma is decimal separator is used. Several tests were red on my machine, but green on build agent.
Related to #847, #868