XSD Numeric Data Type
- Previous Page XSD Date
- Next Page XSD Miscellaneous
Decimal data types are used for numbers.
Decimal data types
Decimal data types are used to specify a number.
Here is an example of a decimal number declaration in a scheme.
<xs:element name="prize" type="xs:decimal"/>
The elements in the document should look something like this:
<prize>999.50</prize>
Or something like this:
<prize>+999.5450</prize>
Or something like this:
<prize>-999.5230</prize>
Or something like this:
<prize>0</prize>
Or something like this:
<prize>14</prize>
Note:The maximum number of decimal digits you can specify is 18.
Integer data types
Integer data types are used to specify numeric values without a fractional component.
Here is an example of an integer declaration in a scheme.
<xs:element name="prize" type="xs:integer"/>
The elements in the document should look something like this:
<prize>999</prize>
Or something like this:
<prize>+999</prize>
Or something like this:
<prize>-999</prize>
Or something like this:
<prize>0</prize>
Numeric data types
Please note that all data types listed below are derived from the decimal data type (except for decimal itself)!
Name | Seconds |
---|---|
byte | 8-bit integers with both positive and negative values |
decimal | Decimal number |
int | 32-bit integers with both positive and negative values |
integer | Integer value |
long | 64-bit integers with both positive and negative values |
negativeInteger | Only integers with negative values ( .., -2, -1.) |
nonNegativeInteger | Only integers with non-negative values (0, 1, 2, ..) |
nonPositiveInteger | Only integers with non-positive values (.., -2, -1, 0) |
positiveInteger | Only integers with positive values (1, 2, ..) |
short | 16-bit integer with sign |
unsignedLong | 64-bit integer without sign |
unsignedInt | 32-bit integer without sign |
unsignedShort | 16-bit integer without sign |
unsignedByte | 8-bit integer without sign |
Restrictions on numeric data types
Restrictions that can be used with numeric data types:
- enumeration
- fractionDigits
- maxExclusive
- maxInclusive
- minExclusive
- minInclusive
- pattern
- totalDigits
- whiteSpace
- Previous Page XSD Date
- Next Page XSD Miscellaneous