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......
This message has been edited. Last edited by: santu,
Web FOCUS 7.7.03
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
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
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.
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
Does the Key Sheet show how to use the FPRINT function with date columns?
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
|Powered by Social Strata|