"Number" (Interpreter Type)
Number in a standard format.
Details
- "Number" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "Number" does not require connectivity to the Wolfram Cloud.
Restriction Specifications
-
Restricted["Number",{{choices1,…}}] one among choices Restricted["Number",max] a number below max Restricted["Number",{min,max}] a number between min and max Restricted["Number",{min,max,s}] a number between min and max, with step s Restricted["Number",Automatic,n] a number with n-digit precision
Options
- The following options can be used:
-
DigitBlock Infinity number of digits between breaks NumberPoint "." decimal point string NumberSeparator {",", " "} string to insert at breaks between blocks NumberSigns {"-",""} strings to use for signs of negative and positive numbers
Examples
Basic Examples (3)
Interpreter["Number"]["42"]Interpret numbers in scientific notation:
Interpreter["Number"]["6.022e23"]Interpret real numbers, with a bound:
Interpreter[Restricted["Number", 100]]["89.7"]Interpreter["Number", NumberPoint -> ","]["10,3"]Restrict to odd numbers below 100:
Interpreter[Restricted["Number", {1, 99, 2}]][{"67", "99", "88"}]Interpreter[Restricted["Number", {-Infinity, Infinity, 3}]]["5"]Interpreter[Restricted["Number", Automatic, 3]]["1.09276"]Otherwise, $MachinePrecision is implied:
Interpreter["Number"]["1.09276"]//PrecisionWhen the number contains a Precision or Accuracy, and a precision restriction is also specified, the lower of the two will be applied:
Interpreter[Restricted["Number", Automatic, 10]]["1.23456789`3"]Interpreter[Restricted["Number", Automatic, 5]]["1.23456789``10"]See Also
Interpreter Restricted Failure
Interpreter Types: SemanticNumber ComputedNumber Integer Real ComplexNumber OrdinalNumber HexInteger RomanNumeral SemanticInteger ComputedInteger SemanticReal ComputedReal SemanticComplexNumber ComputedComplexNumber
Text Contents: Number
Related Guides
History
Introduced in 2014 (10.0)