OpenersNotesSection(Spacer1)Details

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Interpret quantities of any kind:

Interpreter["Quantity"]["2 pounds"]

Interpreter["Quantity"]["65 miles/hr"]

Interpreter["Quantity"]["1000 Canadian dollars"]

Interpret quantities in natural language:

Interpreter["Quantity"]["a half year"]

Interpreter["Quantity"]["one grand"]

Restrict and convert to a unit:

Interpreter[Restricted["Quantity", "Euro"]]["$1000"]

Restrict in an interval:

Interpreter[Restricted["Quantity", "Kilometer",{1,100}]]["20 miles"]

Restrict to a given physical quantity:

Interpreter[Restricted["Quantity", QuantityVariable["Time"]]][{"20 km", "1.5 hr"}]

Interpreter[QuantityVariable["Age"]]["10 years"]

Accept unitless inputs in the presence of an appropriate restriction:

Interpreter[Restricted[QuantityVariable["Money"]]]["100"]

Interpreter[Restricted["Quantity", "Hours"]]["five"]

Set the precision:

Interpreter[Restricted["Quantity", Automatic,Automatic,3]]["1.2345 m"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Quantity, paclet:ref/Quantity])  ▪  (RefLink[QuantityVariable, paclet:ref/QuantityVariable])  ▪  (RefLink[QuantityVariablePhysicalQuantity, paclet:ref/QuantityVariablePhysicalQuantity])  ▪  (RefLink[QuantityVariableCanonicalUnit, paclet:ref/QuantityVariableCanonicalUnit])  ▪  (RefLink[Interpreter, paclet:ref/Interpreter])  ▪  (RefLink[SemanticImport, paclet:ref/SemanticImport])  ▪  (RefLink[Restricted, paclet:ref/Restricted])  ▪  (RefLink[Failure, paclet:ref/Failure])  ▪  (RefLink[UnitConvert, paclet:ref/UnitConvert])}, {Related Interpreter Types:  (RefLink[StructuredQuantity, paclet:ref/interpreter/StructuredQuantity])  ▪  (RefLink[ComputedQuantity, paclet:ref/interpreter/ComputedQuantity])  ▪  (RefLink[PhysicalQuantity, paclet:ref/interpreter/PhysicalQuantity])  ▪  (RefLink[Age, paclet:ref/interpreter/Age])  ▪  (RefLink[Percent, paclet:ref/interpreter/Percent])  ▪  (RefLink[PercentFraction, paclet:ref/interpreter/PercentFraction])  ▪  (RefLink[HeuristicPercent, paclet:ref/interpreter/HeuristicPercent])  ▪  (RefLink[CurrencyAmount, paclet:ref/interpreter/CurrencyAmount])  ▪  (RefLink[CurrencyName, paclet:ref/interpreter/CurrencyName])  ▪  (RefLink[Number, paclet:ref/interpreter/Number])  ▪  (RefLink[ComputedAge, paclet:ref/interpreter/ComputedAge])  ▪  (RefLink[ComputedPercent, paclet:ref/interpreter/ComputedPercent])  ▪  (RefLink[ComputedPercentFraction, paclet:ref/interpreter/ComputedPercentFraction])  ▪  (RefLink[ComputedHeuristicPercent, paclet:ref/interpreter/ComputedHeuristicPercent])  ▪  (RefLink[ComputedCurrencyAmount, paclet:ref/interpreter/ComputedCurrencyAmount])  ▪  (RefLink[SemanticNumber, paclet:ref/interpreter/SemanticNumber])  ▪  (RefLink[ComputedNumber, paclet:ref/interpreter/ComputedNumber])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Setting Up Input Interpreters, paclet:guide/InterpretingStrings])}})}})