QuantityForm
QuantityForm[expr,form]
prints expr with all Quantity expressions using the specified unit display form form.
QuantityForm[expr,{forms}]
prints expr using the appropriate combination of the specified unit display forms forms.
Details
- The following unit display forms can be specified: "Abbreviation", "LongForm".
- "SingularForm" can be included as a display form specification to force "LongForm" descriptions to their singular tense.
- If expr is a canonical unit, QuantityForm will print with the specified form of the unit.
- When an input evaluates to QuantityForm[expr], QuantityForm does not appear in the output. »
Examples
open allclose allBasic Examples (2)
Scope (5)
QuantityForm acts on all Quantity objects in an expression:
Possible display forms are "Abbreviation" and "LongForm":
"LongForm" descriptions will select singular/plural tenses based on the value of each Quantity:
"SingularForm" can be used with "LongForm" to force unit descriptions to be in singular tense:
If the first argument is a canonical unit, QuantityForm will print with the specified form of the unit:
QuantityForm works with MixedUnit specifications:
Properties & Relations (4)
For units without abbreviated form, "Abbreviation" is equivalent to "LongForm":
IndependentUnit specifications do not have special unit display forms:
"Abbreviation" and "LongForm" can be specified together:
When an input evaluates to QuantityForm[expr,form], QuantityForm does not appear in the output:
Out is assigned the value , not QuantityForm[,"LongForm"]:
Possible Issues (2)
The first argument of QuantityForm should be a canonical unit, or an expression containing Quantity:
Even when an output omits QuantityForm from the top level, it is not stripped from subexpressions:
The output does not have QuantityForm in it:
However, the variable e does have QuantityForm in it, which may affect subsequent evaluations:
The QuantityMagnitude is not evaluated due to the intervening QuantityForm:
Assign variables first and then apply QuantityForm to the result to maintain computability:
Text
Wolfram Research (2012), QuantityForm, Wolfram Language function, https://reference.wolfram.com/language/ref/QuantityForm.html.
CMS
Wolfram Language. 2012. "QuantityForm." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/QuantityForm.html.
APA
Wolfram Language. (2012). QuantityForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/QuantityForm.html