-
Notifications
You must be signed in to change notification settings - Fork 386
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 JSON serialization of quantities with decimal values #868
Conversation
Codecov Report
@@ Coverage Diff @@
## master #868 +/- ##
==========================================
- Coverage 83.09% 82.74% -0.36%
==========================================
Files 287 287
Lines 42987 43332 +345
==========================================
+ Hits 35720 35853 +133
- Misses 7267 7479 +212
Continue to review full report at Codecov.
|
Solid work on this 👏 Love the tests! I think it is clever to use string to support How about this:
This makes the schema more extensible to other types of numbers with generics, as have been discussed a number of times: |
75665e8
to
c5af7a1
Compare
I implemented your proposal. |
Add IDecimalQuantity interface to expose the decimal value Serialize decimal values as string to keep number of decimal places
c5af7a1
to
e9a8161
Compare
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.
Looks perfect to me, great work on this!
Nuget is on the way out, I'd appreciate it if you gave it a spin to ensure it works as expected and comment back here! 🙇 |
Why is the version number 4.3.0? |
JsonNet nuget is versioned separately from UnitsNet nuget, but they share major version. |
Add IDecimalQuantity interface to expose the decimal value
Serialize decimal values as string to keep number of decimal places