Skip to content

Numeric types

Any numeric value, equivalent to number in JSON Schema. The base type for all numeric types.

// Scale 0
100
// Scale 1
100.5
// Negative, scale 2
-100.5

A whole number without decimals, equivalent to integer in JSON Schema.

// Positive
42
// Negative
-42

A decimal number (with variable scale) encoded as a string, to avoid floating point issues.

// Scale 0
"100"
// Scale 1
"100.5"
// Negative, scale 2
"-100.50"

TypeSpec supports several other numeric types, including float and decimal. A full list of these types can be found in the TypeSpec documentation.