"CurrencyAmount" (Interpreter Type)
-
See Also
- Interpreter
- SemanticImport
- Restricted
- Failure
- Quantity
-
- Interpreter Types
- ComputedCurrencyAmount
- Quantity
- CurrencyName
- CreditCardNumber
- StructuredQuantity
- ComputedQuantity
-
- Text Contents
- CurrencyAmount
- Related Guides
"CurrencyAmount" (Interpreter Type)
Amount of money expressed in natural language.
Details
- "CurrencyAmount" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "CurrencyAmount" requires connectivity to the Wolfram Cloud.
Allowed Forms
- All the natural-language numbers allowed by "SemanticNumber" are supported for the quantity magnitude.
- All the natural-language units allowed by "CurrencyName" are supported for the quantity unit.
Restriction Specifications
-
Restricted["CurrencyAmount",{{choices1,…}}] one among choices Restricted["CurrencyAmount",unit] convert to unit Restricted["CurrencyAmount",unit,max] an amount of money below Quantity[max,unit] Restricted["CurrencyAmount",unit,{min,max}] an amount of money between Quantity[min,unit] and Quantity[max,unit] Restricted["CurrencyAmount",unit,{min,max,s}] an amount of money between Quantity[min,unit] and Quantity[max,unit] with step s Restricted["CurrencyAmount",Automatic,Automatic,n] an amount of money whose magnitude has n-digit precision - The bounds min and max and step s can also be expressed as quantities.
Interpretation
- "CurrencyAmount" yields a Quantity.
Examples
Basic Examples (4)
Interpreter["CurrencyAmount"]["1 dime"]Interpreter["CurrencyAmount"]["1 billion euro"]Restrict and convert to a unit:
Interpreter[Restricted["CurrencyAmount", "Euros"]]["$1000"]If no unit is provided in the input string, imply US dollars:
Interpreter["CurrencyAmount"]["9.99"]Interpreter[Restricted["CurrencyAmount", Automatic, Automatic, 5]]["1000.2345 $"]See Also
Interpreter SemanticImport Restricted Failure Quantity
Interpreter Types: ComputedCurrencyAmount Quantity CurrencyName CreditCardNumber StructuredQuantity ComputedQuantity
Text Contents: CurrencyAmount
Related Guides
History
Introduced in 2014 (10.0)