How to use numeric data type in XQuery
In this article I am going to explain numeric data type in XQuery.
Numeric data type is used for numeric value. Numeric data type are following types-
- Decimal data type
The xs:decimal data type represents a subset of the real numbers that can be represented by decimal numerals. Decimal data type largest precision is 31 digits.
Decimal has the following constraining facets-
- totalDigits
- fractionDigits
- pattern
- whiteSpace
- enumeration
- maxInclusive
- maxExclusive
- minInclusive
- minExclusive
Example of Decimal data type
<xs:element name="Value" type="xs:decimal"/>
<Value>111.0</Value>
<Value>-1.1</Value>
<Value>+1.1</Value>
|
Integer has the following constraining facets-
- totalDigits
- fractionDigits
- pattern
- whiteSpace
- enumeration
- maxInclusive
- maxExclusive
- minInclusive
- minExclusive
Example of Integer data type
<xs:element name="Value" type="xs:integer"/>
<Value>110</Value>
<Value>-110</Value>
<Value>+110</Value>
<Value>0</Value>
|
Further Readings
You may also want to read these related articles: here
Ask Your Question
Got a programming related question? You may want to post your question here