To prepare numeric data for display as text use the RPG built in functions:
%EDITC(numeric : editcode {: *ASTFILL | *CURSYM | currency-symbol})
Or
%EDITW(numeric : editword)
To convert text input to numeric values use the RPG built in function:
%DEC(numeric expression {:digits:decpos}) – typically in a monitor block like this:
ValidNumber = True;
monitor;
num = %dec(Alpha:15:2) ;
on-error;
ValidNumber = False;
Endmon;
Refer to your RPG documentation for more details.
(RPG) How to convert numbers to text and vice versa
-
MarkDuignan
- Posts: 346
- Joined: Wed Apr 18, 2012 10:33 am