What are the minimum and maximum acceptable values of the decimal type in XML Schema? (type="xs:decimal"
)?

- 106,133
- 27
- 181
- 240

- 183
- 1
- 2
- 9
-
1Seems it's up to your definition of the constraints: [datatype decimal](http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#decimal) – Filburt Nov 13 '14 at 12:59
1 Answers
XML Schema itself does not impose minimum and maximum values on xsd:decimal
:
[Definition:] decimal represents arbitrary precision decimal numbers. The ·value space· of decimal is the set of the values i × 10^-n, where i and n are integers such that n >= 0.
[Contrast this with xsd:float
, which corresponds to IEEE single-precision 32-bit floats.]
Implementations, on the other hand, may support limits to the range of xsd:decimal
:
NOTE: All ·minimally conforming· processors ·must· support decimal numbers with a minimum of 18 decimal digits (i.e., with a ·totalDigits· of 18). However, ·minimally conforming· processors ·may· set an application-defined limit on the maximum number of decimal digits they are prepared to support, in which case that application-defined maximum number ·must· be clearly documented.
[For example, Xerces2-J uses java.math.BigDecimal
; see How to get biggest BigDecimal value for answers on how big BigDecimal can be.]

- 106,133
- 27
- 181
- 240