Focal Point
[Solved] Replace 0 by '-'

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

June 26, 2009, 11:04 AM
Jérény Deidda
[Solved] Replace 0 by '-'
Hi,

I would like to replace 0 by the character '-' in my result.

I tried with this (POUR is I9):

APOUR/A9 = IF POUR EQ 0 THEN '-' ELSE EDIT(POUR);

The problem is that 0 appear like this:

218 becomes 000000218
5214 becomes 000005214
...

Is there a way to convert directlz my 0 in '-'?

This message has been edited. Last edited by: Jérény Deidda,


WebFOCUS 7.6.4 running on Windows
Output formats : PDF, Excel and HTML
My blog
June 26, 2009, 11:11 AM
Laure
Try the CTRAN function

 TABLE FILE EMPLOYEE
PRINT ADDRESS_LN3 AND COMPUTE
ALT_ADDR/A20 = CTRAN(20, ADDRESS_LN3, 48, 45, ALT_ADDR);
BY EMP_ID
WHERE TYPE EQ 'HSM';
END
 



Laure


Prod: WebFOCUS 7.7.03 - MRE, BID, - WindowsXP - Oracle 9i, SQLServer, DevStudio 7.7.3 - Apache Tomcat , Output: HTML, Excel 2013 and PDF
June 26, 2009, 11:12 AM
RSquared
Use the CTRAN Function.



quote:
APOUR/A9 = CTRAN (9,POUR, 060, 055, APOUR;



WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
June 26, 2009, 11:25 AM
Jérény Deidda
Thanks but I become the same result :

25 ---> 000000025


WebFOCUS 7.6.4 running on Windows
Output formats : PDF, Excel and HTML
My blog
June 26, 2009, 11:29 AM
Jérény Deidda
OK I just understood, I changed my ASCII codes and it runs better ,-)


WebFOCUS 7.6.4 running on Windows
Output formats : PDF, Excel and HTML
My blog
June 28, 2009, 05:33 PM
Waz
I would suggest using FTOA.

APOUR/A9 = IF POUR EQ 0 THEN '-' ELSE FTOA(POUR,'F9','A9');



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

July 02, 2009, 04:38 AM
Jérény Deidda
Thanks,

the problem is solved with FTOA.

Topic must be closed and marked as solved.


WebFOCUS 7.6.4 running on Windows
Output formats : PDF, Excel and HTML
My blog
July 02, 2009, 08:25 AM
GamP
quote:
Topic must be closed and marked as solved.

You are the only one who can do that (apart from the forum admin of course).
Go to your very first post and edit it. That will give you the opportunity to change the desription.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988