OpenersNotesSection(Spacer1)Details

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Interpret integers:

Interpreter["Number"]["42"]

Interpret numbers in scientific notation:

Interpreter["Number"]["6.022e23"]

Interpret real numbers, with a bound:

Interpreter[Restricted["Number", 100]]["89.7"]

Use a different number point:

Interpreter["Number", NumberPoint-> ","]["10,3"]

Restrict to odd numbers below 100:

Interpreter[Restricted["Number", {1,99,2}]][{"67","99","88"}]

Restrict to multiples of 3:

Interpreter[Restricted["Number", {-Infinity,Infinity,3}]]["5"]

Set the precision:

Interpreter[Restricted["Number",Automatic,3]]["1.09276"]

Otherwise, (RefLink[$MachinePrecision, paclet:ref/$MachinePrecision]) is implied:

Interpreter["Number"]["1.09276"]//Precision

When the number contains a (RefLink[Precision, paclet:ref/Precision]) or (RefLink[Accuracy, paclet:ref/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"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Interpreter, paclet:ref/Interpreter])  ▪  (RefLink[Restricted, paclet:ref/Restricted])  ▪  (RefLink[Failure, paclet:ref/Failure])}, {Related Interpreter Types:  (RefLink[SemanticNumber, paclet:ref/interpreter/SemanticNumber])  ▪  (RefLink[ComputedNumber, paclet:ref/interpreter/ComputedNumber])  ▪  (RefLink[Integer, paclet:ref/interpreter/Integer])  ▪  (RefLink[Real, paclet:ref/interpreter/Real])  ▪  (RefLink[ComplexNumber, paclet:ref/interpreter/ComplexNumber])  ▪  (RefLink[OrdinalNumber, paclet:ref/interpreter/OrdinalNumber])  ▪  (RefLink[HexInteger, paclet:ref/interpreter/HexInteger])  ▪  (RefLink[RomanNumeral, paclet:ref/interpreter/RomanNumeral])  ▪  (RefLink[SemanticInteger, paclet:ref/interpreter/SemanticInteger])  ▪  (RefLink[ComputedInteger, paclet:ref/interpreter/ComputedInteger])  ▪  (RefLink[SemanticReal, paclet:ref/interpreter/SemanticReal])  ▪  (RefLink[ComputedReal, paclet:ref/interpreter/ComputedReal])  ▪  (RefLink[SemanticComplexNumber, paclet:ref/interpreter/SemanticComplexNumber])  ▪  (RefLink[ComputedComplexNumber, paclet:ref/interpreter/ComputedComplexNumber])}})}})

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