💥Remove decimal support - #1359
Merged
angularsen merged 11 commits intoFeb 23, 2024
Merged
Conversation
angularsen
marked this pull request as ready for review
February 18, 2024 19:54
angularsen
commented
Feb 18, 2024
Owner
Muximizeforce-pushed
the
remove-decimal-support
branch
from
February 19, 2024 16:47
ea94306 to
8f655e4CompareMuximize
commented
Feb 19, 2024
ContributorAuthor
I rebased this to clean up the commit history, which should aid in reviewing. |
They were not specific to decimal, adapted to work with double values.
angularsen
approved these changes
Feb 23, 2024
angularsen
left a comment
Owner
There was a problem hiding this comment.
Looks good to me!
As you said, it's a bit sad to see a lot of thought and work being thrown out, but I still do think reducing this complexity is worth it until we find a better way to support multiple numeric types in a more holistic way.
I made a few minor improvements and pushed it.
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
QuantityValue, replaced withdoubleTValueTypefrom interfacesIQuantity<TUnitType, out TValueType>IValueQuantity<out TValueType>IQuantity<TSelf, TUnitType, out TValueType>toIQuantity<TSelf, TUnitType>IArithmeticQuantity<TSelf, TUnitType, TValueType>toIArithmeticQuantity<TSelf, TUnitType>Changes to UnitsNet.Serialiation.JsonNet
Information,BitRateandPowerstill work, but it now reads justdouble Valueproperty and ignoresstring ValueStringandstring ValueTypeproperties. This may lose precision compared to preserving the fulldecimalvalue, butdecimalis no longer supported in v6.Background
In #1195@angularsen says:
This made me wonder how deep that complexity goes so I decided to experiment, and this is the result.
I must say some of these changes make me a bit sad. A lot of work and some very clever thinking went into supporting multiple numerical types, and I want to acknowledge that. 🙇
Also, I took it as far as possible but that might not be the best outcome, for example we might want to keep deserialization support. This just demonstrates a possible direction we could go in.