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.
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 all close allBasic Examples (2)
Display a quantity using its "LongForm" description:
QuantityForm[Quantity[3, "Meters" / "Seconds"], "LongForm"]Display quantities with multiple unit form specifications:
QuantityForm[Quantity[.75, "Feet"], {"Abbreviation", "LongForm"}]QuantityForm[Quantity[.75, "Feet"], {"Abbreviation", "LongForm", "SingularForm"}]QuantityForm[Quantity[1.2, "Farads"], {"Abbreviation", "LongForm"}]Scope (5)
QuantityForm acts on all Quantity objects in an expression:
QuantityForm[{Quantity[4, "Joules"], Quantity[9, "Sieverts"], Quantity[3, "Ohms"]}, {"Abbreviation", "LongForm"}]QuantityForm[<|"Distance" -> Quantity[260, "Miles"], "Duration" -> Quantity[3, "Hours"]|>, "LongForm"]Possible display forms are "Abbreviation" and "LongForm":
expr = Quantity[5, "Grams" / "Meters" ^ 3]QuantityForm[expr, "Abbreviation"]QuantityForm[expr, "LongForm"]"LongForm" descriptions will select singular/plural tenses based on the value of each Quantity:
QuantityForm[Quantity[1, "Seconds"], {"LongForm"}]QuantityForm[Quantity[.7, "Seconds"], {"LongForm"}]"SingularForm" can be used with "LongForm" to force unit descriptions to be in singular tense:
QuantityForm[Quantity[.7, "Seconds"], {"LongForm", "SingularForm"}]If the first argument is a canonical unit, QuantityForm will print with the specified form of the unit:
QuantityForm["Feet", {"Abbreviation", "LongForm"}]QuantityForm works with MixedUnit specifications:
Quantity[MixedMagnitude[{1, 2}], MixedUnit[{"Feet", "Inches"}]]QuantityForm[%, {"Abbreviation", "LongForm"}]Applications (1)
Properties & Relations (4)
For units without abbreviated form, "Abbreviation" is equivalent to "LongForm":
q = Quantity["UniverseMass"]QuantityForm[q, "LongForm"]QuantityForm[q, "Abbreviation"]IndependentUnit specifications do not have special unit display forms:
q = Quantity[2, IndependentUnit["Unit"]]QuantityForm[q, "LongForm"]QuantityForm[q, "Abbreviation"]"Abbreviation" and "LongForm" can be specified together:
QuantityForm[Quantity[4.7, "Meters" ^ 2], {"LongForm", "Abbreviation"}]When an input evaluates to QuantityForm[expr,form], QuantityForm does not appear in the output:
QuantityForm[Quantity[1, "Meters"], "LongForm"]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:
QuantityForm[{3, "Feet", Quantity[3, "Feet"]}, {"Abbreviation", "LongForm"}]QuantityForm["Feet", {"Abbreviation", "LongForm"}]Even when an output omits QuantityForm from the top level, it is not stripped from subexpressions:
e = QuantityForm[Quantity[1, "Meters"], "LongForm"]The output does not have QuantityForm in it:
%However, the variable e does have QuantityForm in it, which may affect subsequent evaluations:
FullForm[e]The QuantityMagnitude is not evaluated due to the intervening QuantityForm:
QuantityMagnitude[e]Assign variables first and then apply QuantityForm to the result to maintain computability:
QuantityForm[f = Quantity[1, "Meters"], "LongForm"]QuantityMagnitude[f]See Also
Quantity QuantityMagnitude QuantityUnit NumberForm PercentForm Style
Function Repository: QuantityToSimpleString
Tech Notes
Related Guides
History
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
BibTeX
@misc{reference.wolfram_2026_quantityform, author="Wolfram Research", title="{QuantityForm}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/QuantityForm.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_quantityform, organization={Wolfram Research}, title={QuantityForm}, year={2012}, url={https://reference.wolfram.com/language/ref/QuantityForm.html}, note=[Accessed: 13-June-2026]}