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     Need easier way to add commas to an ampervar

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Need easier way to add commas to an ampervar
 Login/Join
 
Silver Member
posted
I have a dollar amt being passed as an ampervar. Is there an easy way to add commas but keep the variable as amper? I know that ampervars are considered alpha, but is there a way to cheat it into thinking that it's not?


------------------------------------------
last version used: v7.1; truly miss the wonderful things I did with WebFOCUS, HTML, & JavaScript.
 
Posts: 36 | Location: Rolling Meadows, IL | Registered: September 05, 2007Report This Post
Expert
posted Hide Post
-SET &NUM1 = 3493762893;
-SET &NUM1A = FTOA(&NUM1,'(D15)','A30');

-TYPE &NUM1 &NUM1A


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
THANK YOU SO VERY MUCH FRANCIS. Can I trouble you to ask you why this works? I have been doing this language quite a long time and would've never thought to use FTOA.

Thanks,
Carol


------------------------------------------
last version used: v7.1; truly miss the wonderful things I did with WebFOCUS, HTML, & JavaScript.
 
Posts: 36 | Location: Rolling Meadows, IL | Registered: September 05, 2007Report This Post
Silver Member
posted Hide Post
Also, one other teenie, tiny question? Is there a way to retain the decimals? My field is actually being passed as 15.3.


------------------------------------------
last version used: v7.1; truly miss the wonderful things I did with WebFOCUS, HTML, & JavaScript.
 
Posts: 36 | Location: Rolling Meadows, IL | Registered: September 05, 2007Report This Post
Expert
posted Hide Post
I think the reason it works is that the input to FTOA is a number, and if the amper variable passed to FTOA in DM looks like a number it's treated as a number not as alpha. Simply change D15 to D15.3 to retain the decimal places.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
Just change the input length to reflect the decimals.

-SET &NUM1 = 3493762893.135;
-SET &NUM1A = FTOA(&NUM1,'(D15.3)','A30');
-TYPE &NUM1 &NUM1A


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Silver Member
posted Hide Post
THANKS!!! I thought of the 15.3 just after I submitted the post and it worked!!! Thanks again!!!


------------------------------------------
last version used: v7.1; truly miss the wonderful things I did with WebFOCUS, HTML, & JavaScript.
 
Posts: 36 | Location: Rolling Meadows, IL | Registered: September 05, 2007Report 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     Need easier way to add commas to an ampervar

Copyright © 1996-2020 Information Builders