LEADING( ) function

Returns a string containing a specified number of leading digits.

Syntax

LEADING(number, leading_digits)

Parameters

Name Type Description
number numeric

The value to return the leading digits from.

leading_digits numeric The number of leading digits to be returned.

Output

Character.

Examples

Basic examples

Literal numeric input

Returns 623:

LEADING(6234.56, 3)

Returns 62345:

LEADING(-6234.56, 5)

Padding with trailing zeros

Returns 000:

LEADING(0.00, 3)

Returns 00000:

LEADING(0.00, 5)

Returns 35500:

LEADING(3.55, 5)

Remarks

Use LEADING( ) to extract digits from a numeric field as a string, and filter out non-digit elements such as decimals or dollar signs.

ACL Scripting Guide 14.1