Quantity¶
Represents a physical quantity with a unit.
Singular unit names are canonicalized to their plural form.
When quantities are multiplied, the compound unit's factors are ordered alphabetically.
Functions like Abs and Floor apply to the magnitude and keep the unit.
Max and Min compare quantities after converting to a common unit, returning
the winner in its original unit.
Sign predicates test the magnitude.
Mod of two compatible quantities returns the result in the divisor's unit.
A compound unit with a negative exponent is written as a quotient, the way the unit itself reads:
$ wo 'ToString[InputForm[Quantity[1, "Meters"/("Seconds"*"Kilograms")]]]'
Quantity[1, "Meters"/("Kilograms"*"Seconds")]
A unit that is only a negative power keeps that form, with the exponent parenthesised:
ToString spells the unit out, using the singular for a magnitude of 1:
TextString abbreviates it instead:
A currency or percent attaches directly to the magnitude:
A compound unit reads as a phrase — and an exponent forces the spelled-out
form even for TextString:
A list is rendered element-wise: