Fixed-decimal Data Types
Go Up to Defining Numeric Data Types
InterBase supports two SQL data types, NUMERIC
and DECIMAL
, for handling numeric data with a fixed decimal point, such as monetary values. You can specify optional precision and scale factors for both data types. These data types are also referred to as exact numerics.
- Precision is the total number or maximum number of digits, both significant and fractional, that can appear in a column of these data types. The allowable range for precision is from 1 to a maximum of 18.
- Scale is the number of digits to the right of the decimal point that comprise the fractional portion of the number. The allowable range for scale is from zero to precision; in other words, scale must be less than or equal to precision.
The syntax for NUMERIC
and DECIMAL
is as follows:
NUMERIC[(precision [, scale])] DECIMAL[(precision [, scale])]
You can specify NUMERIC
and DECIMAL
data types without precision or scale, with precision only, or with both precision and scale.
Topics
- NUMERIC data type
- DECIMAL data type
- How fixed-decimal Data Types are Stored
- Specifying NUMERIC and DECIMAL with Scale and Precision
- Numeric Input and Exponents
- Specifying Data Types Using Embedded Applications
- Considering Migration for NUMERIC and DECIMAL Data Types
- Migrating Databases with NUMERIC and DECIMAL Data Types
- Using Exact Numeric Data Types in Arithmetic