Closed GregJohnStewart closed 2 years ago
Sorry but that request seems odd to near spam.
k, m, g, etc. ARE units already and there is no justification for turning the Dimensionless
constant unit AbstractUnit.ONE
to something else like AmountOfSubstance
.
We might consider physical quantities to form a commutative group under multiplication. AbstractUnit.ONE
is special as with Quantities.getQuantity(1, AbstractUnit.ONE)
we identify the identity element of this group.
Turns out, there can be only one such special Unit instance, for the framework to produce consistent results. Hence its unlikely we ever need to change how its currently implemented.
Not spam, just honest suggestion.
I could be wrong, but I see AbstractUnits.ONE
a representation of "unit of one of something", or a way to count individual things. This is similar to how Units.Mole
represents 6.02214076*10^23 individual things. I could be wrong and if there is already a better unit out there than ONE
it would be good to know.
Thanks @andi-huber for chipping in, if any constant (that is not already part of the natural constants) was useful we might consider that but under a different name.
KILOGRAM, METRE, GRAM
(in certain systems while that is a bit redundant to kg) are all well-defined units, hence no need to change that seems necessary.
Note: the name AbstractUnit.ONE
might be a bit misleading: it does not mean a 'quantity of one' but rather a dimension-less unit aka Unit<Dimensionless>
.
Right, this unit can also be understood as "scale factor of one", which is not a count.
Agreed, it is misleading then.
I feel like these was some misconception on my "k, m, g" thing as well, which was not my main ask. My note there was that it might be useful to describe "one thousand of something", etc.
I think the closest might be a quantity type Each
in uom-domain/retail/quantity
ICU4J introduced constant units (or non-units) like BASE
, etc. in the NoUnit class.
I believe the
AbstractUnits.ONE
should be a unit that describesAmountOfSubstance
, similarly to howUnits.Mole
is.Might also make sense to make
k
, 'm', 'g`, etc units as well, but that can be a different ask.