FIXEDDEC Function

Purpose

Returns a FIXED DEC value with precision and scale.

Syntax

FIXEDDEC(x[,p[q]])

Parameters

x
An expression.
p
A restricted expression specifying the total number of digits in the result. This value must not exceed the implementation limit.
q
A restricted expression specifying the scaling factor of the result. When omitted, a scaling factor of zero is assumed.

If both p and q are omitted, the precision and scale are derived from the source as follows, where M is the maximum Fixed Binary precision and N is the maximum Fixed Decimal precision:

Source code Result
FIXED BIN(p,q) FIXED DEC(r,s)

where r = (N,1+CEIL(p/3.32))

and s = CEIL(ABS(q/3.32))*SIGN(q)

FIXED DEC(p,q) FIXED DEC(p,q)
FLOAT BIN(p) FIXED DEC(r,0)

where r = min(N,CEIL(p/3.32)

FLOAT DEC(p) FIXED DEC(p,0)
BIT FIXED DEC(r,0)

where r = min(N,1+CEIL(M/3.32))

CHAR, GRAPHIC or WIDECHAR FIXED DEC(N,0)