Materialize Logo

numeric Data Type

numeric data expresses an exact number with user-defined precision and scale.

Detail Info
Size 16 bytes
Max precision 38
Max scale 38
Default 38 precision, 0 scale
Aliases decimal

Syntax

Numeric values

int . frac e E - exp
Field Use
Eexp Multiply the number preceeding E by 10exp

Decimal definitions

numeric ( precision , scale )
Field Use
precision The total number of decimal digits to track, e.g., 100 has a precision of 3. However, all numeric values in Materialize have a precision of 38.
scale The total number of fractional decimal digits to track, e.g. .321 has a scale of 3. scale cannot exceed the maximum precision.

Details

Valid casts

From numeric

You can cast numeric to:

To numeric

You can cast the following types to numeric:

Examples

SELECT 1.23::numeric AS num_v;
 num_v
-------
     1

SELECT 1.23::numeric(38,3) AS num_38_3_v;
 num_38_3_v
------------
      1.230

SELECT 1.23e4 AS num_w_exp;
 num_w_exp
-----------
     12300