DECIMAL: Converting to Decimal Format

How to:

The DECIMAL function converts a number to fixed-length decimal format.


Top of page

x
Syntax: How to Convert to the Decimal Format
DECIMAL(arg, [length [,dec-places]])

where:

arg

Numeric

Is the input value.

length

Integer

The maximum number of digits in the integer portion of the result. The default is 15.

dec-places

Integer

Is the number of decimal places in the result. The default is the same number of decimal places as in the type of the argument.

This function returns a numeric value in fixed-length decimal format.



Example: Converting to Decimal Format

DECIMAL converts a number to fixed-length decimal format. This example,

DECIMAL(5.12345, 4, 2)

returns 5.12.


iWay Software