decimal Data Type

decimal 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

Syntax 

Decimal values 

int . frac

Decimal definitions 

decimal ( precision , scale )
Field Definition
precision The total number of decimal values to track, e.g., 100 has a precision of 3. However, all decimal values in Materialize have a precision of 38.
scale The total number of fractional decimal values to track, e.g. .321 has a scale of 3.

Details 

Valid casts 

From decimal 

You can cast decimal to:

To decimal 

You can cast the following types to decimal:

Examples 

SELECT 1.23::decimal AS dec_v;
 dec_v
-------
     1

SELECT 1.23::decimal(38,3) AS dec_38_3_v;
 dec_38_3_v
------------
      1.230