Returns the display length (in characters) of a numeric expression.

Syntax

LENNUM(<expN>)

<expN>

The numeric or float number whose display length to return.

Description

Use LENNUM( ) before formating a display involving numeric values of varying lengths.

If you pass LENNUM( ) the name of a numeric field, it returns the length of the field.

If a number has eight or fewer whole-number digits and no decimal point, it is by default a numeric-type number; the default display length for numeric-type numbers is 11. For example:

?LENNUM(123)

returns 11.

If a number contains a decimal point, the value returned by LENNUM( ) will depend on the value of SET DECIMALS TO. The minimum value returned will be comprised of the minimum default length (11), a character for the decimal point (1) plus the value of SET DECIMALS TO (regardless of how many decimal places are actually utilized). Therefore, where SET DECIMALS TO = 2;

?LENNUM(122.1)

  and

?LENNUM(122.11)

both return 14.

The maximum length returned by LENNUM( ) is 39.

If a number passed to LENNUM( ) is null, LENNUM( ) returns a null “value”.