Skip to main content

NUMBER type conversion rules

The storage format of the NUMBER type in seekdb is the same, but it can be divided into four formats based on the value domain definition, as shown in the following table.

Storage typeDefault storage rules in seekdb
Fixed-point number DECIMAL(M,D) = {10^{-D}*i | i = 0,1,...,10^M-1} where M is a natural number and D is an integer
  • DECIMAL = DECIMAL(10, 0)
  • DECIMAL(M) = DECIMAL(M, 0)
  • The value range of DECIMAL(M, D) is: 0 <= D <= M <= 65
Unsigned fixed-point number DECIMAL(M,D)
  • DECIMAL
  • DECIMAL(M)
  • DECIMAL(M,D)
  • Supports the UNSIGNED attribute
Floating-point numberNot supported

The conversion rules between all NUMBER types in seekdb are as follows. The "-" in the table indicates that the conversion is not supported across compatibility modes.

tip

Unsigned fixed-point numbers exist only in seekdb.

Instant conversion allowed (From\To)Fixed-point number(M2,D2)Unsigned fixed-point number(M2,D2)Floating-point number
Fixed-point number(M1,D1)Conversion condition: D1 <= D2 and M1-D1 <= M2-D2Not supportedConversion condition: M-D <= 38
Unsigned fixed-point number(M1,D1) UNSIGNEDConversion condition: D1 <= D2 and M1-D1 <= M2-D2Conversion condition: D1 <= D2 and M1-D1 <= M2-D2-
Floating-point numberNot supported-Supported