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  iWay Software Product Forum on Focal Point    [CLOSED] Yanking the last digit from decimals

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Yanking the last digit from decimals
 Login/Join
 
Member
posted
How would I yank the last digit from a 3 decimal places to two without rounding the 2 decimal place?

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8105
Windows, Excel
 
Posts: 15 | Registered: November 03, 2017Report This Post
Expert
posted Hide Post
Stick the number into a packed decimal field.

DEFINE/COMPUTE NEWFIELD/P20.2 = MY20D3FIELD ;


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
You can use define or compute for changing the format else simple put format with / for example

TABLE FILE CAR
SUM
SALES/D20.2
BY MODEL
END

FORMAT D20.2 will restrict yr decimal filed value upto 2 decimal place.


webfcous 8202m
windows 7
 
Posts: 6 | Registered: July 25, 2017Report This Post
Member
posted Hide Post
Hello,

It is still rounding the next digit.

Here is what I need:
1.999 will be 1.99
I hope this help some.


WebFOCUS 8105
Windows, Excel
 
Posts: 15 | Registered: November 03, 2017Report This Post
Platinum Member
posted Hide Post
You can be trying the one method of use INT. This not be nice but work!
TABLE FILE CAR
  SUM COMPUTE VALUE/D12.3 = IF LAST VALUE EQ 0 THEN 1.99 ELSE LAST VALUE + 0.001;
-* This is be line important for you
      COMPUTE BASE/P7.2 = INT(VALUE * 100) / 100;
   BY CAR
ON TABLE SET PAGE NOLEAD
END

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
 
Posts: 106 | Registered: April 06, 2009Report This Post
Platinum Member
posted Hide Post
Forgot, no use double precision as is retains all decimals - no good for you and this. Need packed decimal like Waz say as no retain decimals after using INT.

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
 
Posts: 106 | Registered: April 06, 2009Report This Post
Expert
posted Hide Post
quote:
It is still rounding the next digit.


Ho PO,

What code did you use ?

The P format should work for you


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Multiple it by 1000 then convert it to an alpha with the edit function, then replace the last character with a 0, then convert is back to a decimal and then device by 1000.




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [CLOSED] Yanking the last digit from decimals

Copyright © 1996-2020 Information Builders