Focal Point
[SOLVED] How to append brackets( '(' , ')') to string

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

June 01, 2013, 03:51 AM
santu
[SOLVED] How to append brackets( '(' , ')') to string
Hi All,

I am facing problem with appending brackets to String in webfocus. below is my scenario.

In one of my table, one column having values in dollars(ex: $23,456,234.456).

While displaying i need to check whether it is in negative or not. If it is lessthan zero then i need to remove the -ve sign and need to add brackets to value.

I am doing this like below

COMPUTE T_STOCK_AMT1/A50 = IF T_STOCK_AMT LE 0.0 THEN FTOA(T_STOCK_AMT*-1, '(D20.2M)', T_STOCK_AMT1) ELSE FTOA(T_STOCK_AMT, '(D20.2M)', T_STOCK_AMT1);

where T_STOCK_AMT is the column name.

At last i am storing the value in "T_STOCK_AMT1". Now i need to add the brackets to T_STOCK_AMT1. I am trying like below

COMPUTE ASD/A50 = '(' | T_STOCK_AMT1 | ')';

But its not working.
can you please solve my problem......

Roll Eyes

This message has been edited. Last edited by: santu,


Web FOCUS 7.7.03
PDF
June 01, 2013, 08:06 AM
FrankDutch
Does the field need to be a alpha format field?
Or would it better be an amount with all advantages of that and just show the way you want?

In that case try this

COMPUTE NEWVALUE/D15.2B=Tstockamt ;

You can also do this just in the report. Look in documentation and see how many format settings you have




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

June 01, 2013, 08:13 AM
santu
Ya just now i found this in report painter before i saw your post.

If you don't mind can you provide me any tutorial regarding this???

Thankyou for your solution


Web FOCUS 7.7.03
PDF
June 02, 2013, 04:21 AM
Vivian
Santu,

I would strongly recommend the WebFOCUS Keysheet Release 8.0.2 available at www.aviter.com. It has all the formats of all fields laid out in a very fast quick lookup format. You can have it minimized as a PDF on your PC or tablet type device -- or of course the printed book version is also available.

You won't have to spend time "reading" - It is a quick lookup with everything right there --- You should check it out! Just might help you out quickly and SAVE you time.


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com

June 03, 2013, 10:13 AM
Francis Mariani
Vivian,

Does the Key Sheet show how to use the FPRINT function with date columns?

Thanks,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server