Focal Point
[SOLVED] How to -READ or -READFILE into variable with display formats like , and %

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9597048236

August 15, 2013, 01:10 PM
bug
[SOLVED] How to -READ or -READFILE into variable with display formats like , and %
I was trying to read numbers from a hold file, but found that in the hold file they are just raw numbers without formatting. All comma and percentage sign % are gone. Is there a way to read the formatted number in to a variable?

Thanks.

This message has been edited. Last edited by: <Kathryn Henning>,


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
August 15, 2013, 02:54 PM
nd
Use FPRINT to convert the contents to a string, and include any formatting tweaks in the arguments.

In this example, in the master file, DEALER_COST is a D7 field.

Here's an example with CAR:

 
-DEFAULTH &NDEALER_COST='';
SET HOLDLIST = PRINTONLY
SET ASNAMES  = ON
-*

TABLE FILE CAR
SUM 
     COMPUTE NDEALER_COST/A30=FPRINT(DEALER_COST,'D9.2CM',NDEALER_COST);
ON TABLE NOTOTAL
ON TABLE HOLD AS MYCAR
END
-RUN
-READFILE MYCAR
-TYPE &NDEALER_COST
 



WF: WebFocus 7.7.03
Data: Oracle, MSSQL, DB2
OS: Windows
Output: HTML/AHTML,PDF,EXL2K FORMULA, COMT
August 15, 2013, 04:21 PM
bug
Good solution, thanks nd!


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)