"Quantity" (interpreter type)

Natural-language quantity with units.

DetailsDetails

  • "Quantity" can be used in Interpreter and related constructs, including deployed smart form fields.
  • Use of "Quantity" requires connectivity to the Wolfram Cloud.

Allowed FormsAllowed Forms

  • All the natural-language numbers allowed by "SemanticNumber" are supported for the quantity magnitude.
  • Examples of unit specifications include:
  • one dimenatural-language units
    8.9 hours per day/personcompound units
    30 °Cunit abbreviations and symbols
    10 milespostfix units
    $99.99prefix units

Restriction SpecificationsRestriction Specifications

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Interpret quantities of any kind:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Interpret quantities in natural language:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Restrict and convert to a unit:

In[1]:=
Click for copyable input
Out[1]=

Restrict in an interval:

In[1]:=
Click for copyable input
Out[1]=

Restrict to a given physical quantity:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Accept unitless inputs in the presence of an appropriate restriction:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Set the precision:

In[1]:=
Click for copyable input
Out[1]=
Translate this page: