Skip to content

Is there a unit of measure that measures the general amount of something? #1524

Answered by lipchev
lkomanetz asked this question in Q&A
Discussion options

You must be logged in to vote

I think the closest thing to a "unit of something" would be the https://github.com/angularsen/UnitsNet/blob/master/Common/UnitDefinitions/Scalar.json.

However I'm not sure if this is really well suited for representing countable things (given the floaty-point nature of the IQuantity). You could map another unit abbreviation for it's unit, and using an integer-based format for the ToString etc, but I don't know..

I've personally used this type of definition OrderedAmount : OneOfBase<Volume, Mass, UnitaryQuantity> , where the last one is simply not an IQuantity (but usually comes with a unit such as pcs, as in "10 pcs").

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lkomanetz
Comment options

Answer selected by lkomanetz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants