I would like to be able to call the Quantity
function with a null unit so that it returns the original dimensionless value. For example,
Quantity[3.0,"NoUnits"]
would return 3.0
. Is there a dimensionless unit?
Answer
I believe you can use "DimensionlessUnit"
to get the desired result:
Quantity[3, "DimensionlessUnit"]
3
(note this is the unit produced by QuantityUnit
on a dimensionless value):
QuantityUnit[3]
"DimensionlessUnit"
Comments
Post a Comment