%EDITW (Edit Value Using an Editword)

%EDITW(numeric : editword)

This function returns a character result representing the numeric value edited according to the edit word. The rules for the numeric value and edit word are identical to those for editing numeric values in output specifications.

Float expressions are not allowed in the first parameter. Use %DEC to convert a float to an editable format.

The edit word must be a character constant.

For more information, see Conversion Operations or Built-in Functions.

Figure 212. %EDITW Example
 *..1....+....2....+....3....+....4....+....5....+....6....+....7...+....
D*Name++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++
D amount          S             30A
D salary          S              9P 2
D editwd          C                    '$ ,   ,  **Dollars&  &Cents'

 * If the value of salary is 2451.53, then the edited version of
 * (salary * 12) is '$***29,418*Dollars 36 Cents'. The value of
 * amount is 'The annual salary is $***29,418*Dollars 36 Cents'.

 /FREE
   amount = 'The annual salary is '
                 + %editw(salary * 12 : editwd);
 /END-FREE


[ Top of Page | Previous Page | Next Page | Contents | Index ]