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     [CLOSED] Doubt on Rounding value

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Doubt on Rounding value
 Login/Join
 
Member
posted
Hi,

I have FOCUS report and the result of values are showing after process the data. Below is statement of report logic.

File details:
-------------
FILE=FL1,SUFFIX=FIX ,$
SEGNAME=FL1EXTR ,$
FIELD=FL_FLD1 , ,P12.1 ,P6 ,$
FIELD=FL_FLD2 , ,A2 ,A2 ,$


Logic details:
-------------
DEFINE FILE FL1
VAR_01/P8.1S = IF FL_FLD2 NE '10'
THEN (FL_FLD1/1000)
ELSE FL_FLD1;
END

'FL_FLD1' values are given below respectively.
1455.5
4650.7
6355.7
5850.0
22053.0
8252.0
1057.8
1059.5
8752.4

After executing the logic, i have got the results in VAR_01 given below

1.5
4.7
6.4
5.8
22.1
8.3
1.1
1.1
8.8


My doubt is, for 5850.0 value it should come like 5.9 after rounding like other values. But how it showed like 5.8 in results?

-Nath

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8
Windows, All Outputs
 
Posts: 6 | Registered: August 13, 2015Report This Post
Expert
posted Hide Post
Try changing your packed-decimal (P12.1) to double precision (D12.1) and see what difference that makes.

Then hit the manual to see how these are treated in each case.

T

Edited so that you see the difference!!!

This message has been edited. Last edited by: Tony A,



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
Member
posted Hide Post
Hi,

I have tried with P12.2 definition and still giving the same result. I am checking in manual but no clue on this :-(

-Nath


WebFOCUS 8
Windows, All Outputs
 
Posts: 6 | Registered: August 13, 2015Report This Post
Virtuoso
posted Hide Post
Try D12.2 not P12.2


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
Did you try Tony A's suggestion:
Try changing your packed-decimal (P12.1) to double precision (D12.1) and see what difference that makes.
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Gold member
posted Hide Post
Try this:

  
DEFINE FILE FL1
VARD/D25.18 = FL_FLD1/1000 ;
VAR_01/P8.1S = IF FL_FLD2 NE '10'
THEN (FL_FLD1/1000)
ELSE FL_FLD1;
END
TABLE FILE FL1
PRINT FL_FLD1 FL_FLD2 VARD VAR_01
END


You may see the actual double value of VARD makes the rounding understandable.


IBI Development
 
Posts: 61 | Registered: November 15, 2005Report This Post
Platinum Member
posted Hide Post
The rounding rules I was taught agree with 5.8. You round to the even on a tie.


WebFOCUS 8.2.03 - Production
WebFOCUS 8.2.04 - Sand Box
Windows 2012 R2 Server
HTML, PDF, Excel
In FOCUS since 1980
 
Posts: 115 | Location: Seattle, WA | Registered: April 07, 2015Report 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     [CLOSED] Doubt on Rounding value

Copyright © 1996-2020 Information Builders