Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     EDIT option - Converting numbers to alphanumeric

Read-Only Read-Only Topic
Go
Search
Notify
Tools
EDIT option - Converting numbers to alphanumeric
 Login/Join
 
Platinum Member
posted
Hi,

I have the following issue with edit field. My requirement is the data in the BONUS field has to be formatted as follows:
1. '.' to be changed as ','
2. ',' to be changed as '.'
Eg: 1,234,567.890 to be changed as 1.234.567,890
I am using the EDIT option for this. But the number after the decimal point is not coming in the output. Can anybody help regarding this?

Here is a sample code:

DEFINE FUNCTION DELIMS (VAL1/D14.2)
DELIMS/A20 = EDIT(VAL1,'99.999.999.999.999');
END

TABLE FILE EMPLOYEE
PRINT CURR_SAL
COMPUTE BONUS1/D14.2B=CURR_SAL*123456.345;
COMPUTE BONUS/A20=DELIMS(BONUS1);
END

Thanks for your help.


Regards,
Cyril Joy.

WF Production 8008 on Linux.
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
Platinum Member
posted Hide Post
Hi Cyril

try this :

SET CDN =ON

TABLE FILE EMPLOYEE
PRINT CURR_SAL
COMPUTE BONUS1/D14.2B=CURR_SAL*123456.345;
END

Regards

Peter


D: WF 7.6.2 P. : WF 7.6.2 on W2003
------------------------------------------------------------------
I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.

-Jim Morrison-

 
Posts: 206 | Registered: February 25, 2005Report This Post
Expert
posted Hide Post
Cyril,

Change your function to -

DEFINE FUNCTION DELIMS (VAL1/D14.2)
VAL2/A20 = FTOA(VAL1, '(D14.2)', 'A20');
-*DELIMS/A20 = EDIT(VAL2,'99.999.999.999.999');
DELIMS/A20 = CTRAN(20, VAL2, 46, 99, 'A20');
DELIMS/A20 = CTRAN(20, DELIMS, 44, 46, 'A20');
DELIMS/A20 = CTRAN(20, DELIMS, 99, 44, 'A20');
END


Basically -
1. convert the double precision number to alpha,
2. transpose decimal points to an arbitary chars,
3. transpose commas to decimal points,
4. transpose arbitary chars to commas


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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Scrap that, use Petes simple version and if you need it in alphanumeric format use FTOA.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
That is fantastic. Thanks Peter. Thanks Tony.


Regards,
Cyril Joy.

WF Production 8008 on Linux.
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     EDIT option - Converting numbers to alphanumeric

Copyright © 1996-2020 Information Builders