Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML Schema Numeric Data Types

XSD Numeric Data Types



Decimal Data Type

The decimal data type is used to specify a numeric value.

The following is an example of a decimal declaration in a schema.

The element in the document should look like this:

999.50

or like this:

+999.5450

or like this:

-999.5230

or like this:

0

or like this:

14

Note: The maximum number of decimal digits you can specify is 18.


Integer Data Type

The integer data type is used to specify a value with no fractional component.

The following is an example of an integer declaration in a schema.

The element in the document should look like this:

999

or like this:

+999

or like this:

-999

or like this:

0


Numeric Data Types

Please note that all of the following data types are derived from the decimal data type (except decimal itself)!

Name Seconds
byte Signed 8-bit integer
decimal Decimal number
int Signed 32-bit integer
integer Integer value
long Signed 64-bit integer
negativeInteger Integer containing only negative values ( .., -2, -1.)
nonNegativeInteger Integer containing only non-negative values (0, 1, 2, ..)
nonPositiveInteger Integer containing only non-positive values (.., -2, -1, 0)
positiveInteger Integer containing only positive values (1, 2, ..)
short Signed 16-bit integer
unsignedLong Unsigned 64-bit integer
unsignedInt Unsigned 32-bit integer
unsignedShort Unsigned 16-bit integer
unsignedByte Unsigned 8-bit integer

Restriction on Numeric Data Types

Restrictions that can be used with numeric data types: