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.
I was just about to post when my browser refreshed and I saw the EXACT code I was posting in j.gross's post. So I won't repeat. Any format/precision conversion you do is going to automatically round and I don't think there is any way around it except truncating the number as suggested.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
Thanks to all who replied. True, 2.985232 will properly round to 2.99 but my customer specifically requested two decimal places and no rounding. So, both J.Gross and FrankDutch provided simple one-line working solutions. I actually came up with some code that worked but I'd be embarrassed to post it here! Of course I've only been writing FOCUS at the code level for twenty years so I'm a little new at this. Thanks again.
Steve
Dev Studio /7.6.11/7.7.02M MVS/USS AIX/SOLARIS Windows WF Client 7.6.8/7.6.11
Posts: 64 | Location: Eastern and middle NC | Registered: March 13, 2007
Steve, as Susannah said, I would so use Frank's method - that has worked well for me over the years, but if you want 2 decimal places and no rounding here goes:
quote:
DEFINE FILE CAR ORIG_VALUE/D20.2=2.986232; FLD0/D20.2 = ORIG_VALUE * 100 ; IVAL/I4 = IMOD(FLD0, 1000, IVAL); AVAL/A6=EDIT(IVAL,'$9.99'); DVAL/D20.2=ATODBL(AVAL, '6', DVAL); END
TABLE FILE CAR PRINT ORIG_VALUE FLD0 IVAL AVAL DVAL BY COUNTRY END -EXIT
This message has been edited. Last edited by: ira,