NumberToDisplayString

Mon 01 January 2018

Syntax

NumberToDisplayString(Format, Number [, Width] [, Precision])

Description

Use the NumberToDisplayString function to format Number according to the pattern specified in Format . The decimal and thousand's separator are formatted with what is with the current user's personalizations.

Specify the Width and Precision parameters when you want to dynamically specify the width or precision. Both width and precision can be set based on Format . For example, the following statically specifies the width to be 6, and the precision to be 2:

&MyValue = NumberToDisplayString("%6.2", &Num);

The following example show the width taken dynamically from the &Width variable:

&MyValue = NumberToDisplayString("%*.2", &Num, &Width);

The following example shows how both the width and the precision values are taken dynamically from the &Width and &Precision variables, respectively.

&MyValue = NumberToDisplayString("%*.*", &Num, &Width, &Precision);

Parameters

Field or Control

Definition

Format

Specify the pattern for how Number is supposed to be formatted. See Using the Format parameter, below.

Number

Specify the number to be formatted.

Width

Specify the width of the string to be formatted.

Precision

Specify the precision of the string to be formatted.

Returns

A string value.