Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] CONVERTING -READ VARIABLE TO DECIMAL FORMAT
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] CONVERTING -READ VARIABLE TO DECIMAL FORMAT
 Login/Join
 
Silver Member
posted
I am using a -READ. I'm reading a value of '11,334', when I display the read &Variable in my footer the comma is not being read '11334' appears. How can I convert this &Variable to include the comma. I don't see any functions in the manual that cover this. I did find an 'ATODBL' function, but it is not a Dialogue Manager function. Anyone have any suggestions? Thanks!

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


WebFOCUS 7.7
Exl2k
 
Posts: 34 | Registered: May 23, 2014Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Nope, DIY:

  
-SET &TEST_LEN  = ARGLEN(9, '&VARIABLE.EVAL', I3);
-SET &TEST_VAL  = IF &TEST_LEN LE 3 THEN &&VARIABLE ELSE
-                 IF &TEST_LEN FROM 4 TO 6 THEN EDIT(&VARIABLE,'999,999')
-                  ELSE EDIT(&VARIABLE,'999,999,999');

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 7.7.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1942 | Location: Parker, CO | Registered: January 31, 2006Reply With QuoteReport This Post
Guru
posted Hide Post
Nice but here is a little more context on the idea.

-SET &VARIABLE = 222111000;


-SET &TEST_LEN = ARGLEN(9, '&VARIABLE.EVAL', I3);
-SET &TEST_VAL = IF &TEST_LEN LE 3 THEN &VARIABLE
- ELSE IF &TEST_LEN EQ 4 THEN EDIT(&VARIABLE,'9,999')
- ELSE IF &TEST_LEN EQ 5 THEN EDIT(&VARIABLE,'99,999')
- ELSE IF &TEST_LEN EQ 6 THEN EDIT(&VARIABLE,'999,999')
- ELSE IF &TEST_LEN EQ 7 THEN EDIT(&VARIABLE,'9,999,999')
- ELSE IF &TEST_LEN EQ 8 THEN EDIT(&VARIABLE,'99,999,999')
- ELSE IF &TEST_LEN EQ 9 THEN EDIT(&VARIABLE,'999,999,999')
- ELSE EDIT(&VARIABLE,'999,999,999');

-SET &VARIABLE = '$'| &TEST_VAL;

-TYPE &VARIABLE


Senior Business Intelligence Analyst (BIA) @ Enclara Pharmacia
Production: WF 8.09, App Studio, BIP, RC, MSSQL / Test: WF 8204, App Studio, BIP, Reportcaster, Resource Manager, MSSQL
 
Posts: 290 | Location: Greater Cincinnati  | Registered: May 11, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Yep, Don is correct, My bad! Fixed the bad code too(the & name, left the rest)...


Tom Flynn
WebFOCUS 7.7.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1942 | Location: Parker, CO | Registered: January 31, 2006Reply With QuoteReport This Post
Guru
posted Hide Post
Hey, it takes a village Smiler


Senior Business Intelligence Analyst (BIA) @ Enclara Pharmacia
Production: WF 8.09, App Studio, BIP, RC, MSSQL / Test: WF 8204, App Studio, BIP, Reportcaster, Resource Manager, MSSQL
 
Posts: 290 | Location: Greater Cincinnati  | Registered: May 11, 2005Reply With QuoteReport This Post
Silver Member
posted Hide Post
Thank you guys so much, You all are the best. It does take a village. Don I had to add a trim function but I got it working. See Below:


-SET &TRMCASE = TRIM('L', '&VARIABLE.EVAL', 11, ' ', 11, 'A9');
-SET &TEST_LEN = ARGLEN(9, '&TRMCASE.EVAL', I3);
-SET &TEST_VAL = IF &TEST_LEN LE 3 THEN &TRMCASE
- ELSE IF &TEST_LEN EQ 4 THEN EDIT(&TRMCASE,'9,999')
- ELSE IF &TEST_LEN EQ 5 THEN EDIT(&TRMCASE,'99,999')
- ELSE IF &TEST_LEN EQ 6 THEN EDIT(&TRMCASE,'999,999')
- ELSE IF &TEST_LEN EQ 7 THEN EDIT(&TRMCASE,'9,999,999')
- ELSE IF &TEST_LEN EQ 8 THEN EDIT(&TRMCASE,'99,999,999')
- ELSE IF &TEST_LEN EQ 9 THEN EDIT(&TRMCASE,'999,999,999')
- ELSE EDIT(&TRMCASE,'999,999,999');


WebFOCUS 7.7
Exl2k
 
Posts: 34 | Registered: May 23, 2014Reply With QuoteReport This Post
Platinum Member
posted Hide Post
It looks like the FPRINT function does this:

-SET &Integer = ' 1234567' ;
-SET &Integer = FPRINT(&Integer, 'P12C', 'A15');
-TYPE Integer = &Integer


WF 8.2.03
Win10 / IE11
AHTML EXL2K PDF COMT WP ZIP
 
Posts: 134 | Registered: October 19, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] CONVERTING -READ VARIABLE TO DECIMAL FORMAT

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.