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
January 25, 2010, 05:57 PM
TryFocus
Thank you for response.. I guess my question was interpretted wrong.
Variable has Alpha value ie:25,258.12
&VAR/A15 = '25,258.12' ; I want to convert this comma seperated Alpha value to Decimal, so that I perform some computations.
Conversion from alpha to Decimal '25,258.12' --> 25258.12
Thanks
Prod: WF 7.6.10 windows. -- MRE/Dashboard/Self Service/ReportCaster - Windows XP
January 26, 2010, 03:28 AM
Tony A
Prarie gave you the answer, however you will have to preprocess the alpha value to remove commas.
However, by the time you've stripped (hint) out the comma(s) you could then just use Francis' suggestion as it is a variable (which doesn't really have a format).
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
January 26, 2010, 04:56 AM
Alan B
Always an interesting one this. For calculations in DM, always done in double precision, but displayed truncated unless DMPRECISION is used.
ATODBL, which seems to be needed and cannot take commas in the input string, is not needed. &variables are what they contain(ish).
So get rid of the commas, using STRREP, then the variable can be used in calculations.
The redisplay is then an issue, as 123456.70 displays as 123456.7, so use FTOA to get a full 2 decimal point display.
THEN decide how you want the result of a calculation displayed. Using F10.2 truncates the decimals and D10.2 rounds the decimals, but then D10.2 will also add the comma in and F10.2 doesn't. Go figure which you want.