Sometimes the data provided or accepted by an API ultimately resides in a (relational) database, and most databases have a NUMBER type that allows storing numbers with decimal mantissa. The potential values of a NUMBER column are restricted by
- precision: number of significant decimal digits
- scale: the place where the decimal point resides, counted from the right
This can of course be expressed with minimum, maximum, and multipleOf, e.g.
minimum: -9999999.999
maximum: 9999999.999
multipleOf: 1e-3
Yet it would be nicer to just say
This could also be used for DECFLOAT values:
precision: 34
# scale is variable
is a long DECFLOAT, the short one would have precision: 16