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.
Why when first digit to be dropped is 5, it sometimes get round up and somtimes get round down?
I read data from DB2 table, there 'Rate_A','Rate_B', 'Rate_C' defined as S9(1)V9(4) comp-3, which is one digit at left of the decimal point, 4 digits at right, and it is packed decimal.
First I read it from DB2 table, hold it as a hold file, define a new percentage field in the hold file by multiple it with 100. As:
Then when I display, I only want to display one digit after decimal:
PRINT Rate_A_Pecent/P7.1 AS "Rate_A %" Rate_B_Pecent/P7.1 AS "Rate_B %" Rate_C_Pecent/P7.1 AS "Rate_C %"
But the result, is not conistent, we found when the 2nd digit to be dropped is 5, it sometimes get round up and somtimes get round down. Any idea of why? or how to make it consistent? thanks,This message has been edited. Last edited by: Kerry,
An old trick would be to add a small number to the RATE fields:
DEFINE FILE CAR
RATE_A/D7.4 = (0.5175 + .00001) * 100;
RATE_B/D7.4 = (0.5035 + .00001) * 100;
RATE_C/D7.4 = (0.4685 + .00001) * 100;
END
TABLE FILE CAR
PRINT
RATE_A/D7.1
RATE_B/D7.1
RATE_C/D7.1
DEALER_COST
BY COUNTRY
BY CAR
END
The decimal portion of a floating-point value as it is internally represented in hexadecimal floating-point notation is repeating (that is, non-terminating), the repeating hexadecimal number is resolved as a non-repeating slightly lower number, and this lower number is stored as the field value.
While the original number, 1.15, would have been rounded upward to 1.2 (since the first extra digit was 5 or greater), the number as stored is slightly less than 1.15 (1.149999) and, as the first extra digit is now less than 5 (4 in this case), it is rounded down to 1.1.
Refer to "Describing Data With WebFOCUS Language" --> Chapter - 4 Describing Individual Filed --> USAGE --> Rounding