Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [CLOSED] Yanking the last digit from decimals
Go
New
Search
Notify
Tools
Reply
  
[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, 2017Reply With QuoteReport 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.01OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 5879 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport 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: 5 | Registered: July 25, 2017Reply With QuoteReport 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, 2017Reply With QuoteReport 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: 103 | Registered: April 06, 2009Reply With QuoteReport 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: 103 | Registered: April 06, 2009Reply With QuoteReport 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.01OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 5879 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport 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: 839 | Registered: May 24, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

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-2018 Information Builders, leaders in enterprise business intelligence.