Focal Point
[NFR?] Surpress Trailing Zeros

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1137058236

August 15, 2013, 03:06 PM
Doug
[NFR?] Surpress Trailing Zeros
I think that I have some brain freeze going on here. So, please help me out with what I think is a simple Q&A.

Wahts' the format to suppress trailing zeros in a D#.# field. That is, how do I get "SUM COMPUTE THIS1/D12.6 = 100 / 16.1;" to show up as "6.21118" instead of "6.211180" while maintaning the alignment of the decimal points? Oh, I need to mention that this is only to be done using the format of the field as in "THIS2/D12.6L" adds leading zeros and the default which supresses leading zeros (THIS2/D12.6S).

This message has been edited. Last edited by: Doug,




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
August 15, 2013, 04:06 PM
njsden
I've never seen such a way of formatting numbers in WebFOCUS. So you want to see results this way?

   6.21118
  12.42
   1.008912
  99.999
 713.6


I went through the documentation and could not find any format modifier that would allow for such a thing Frowner

I sure hope someone will give that magic format option and/or setting as now I am intrigued.

This message has been edited. Last edited by: njsden,



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
August 15, 2013, 06:09 PM
Doug
Thanks for your reply... this is a good representation of what I want.

I think that trailingf zeros, to the right of a decimal point, are about as useless as leading zeros to the left of a decimal point. Now, we have a format to show / suppress (default) those, so why not the same for the trailing zeros...

I Thought that I did this many years ago... Probably in another language or life...
August 15, 2013, 06:31 PM
Waz
Its a pity that it has to be a format option, as you can do it other ways.

What is the output format ?


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!

August 15, 2013, 08:39 PM
Doug
The format is D12.6 is for longitude / latitude (something like 42.701). But, Sorry, I'm not going to the trouble (as little at that might be, it's not in the specs, just matching some Java forms) to reformat / EDIT it. I just thought that there was something like D12.6T, where "T" sill suppress the trailing zeros the way the "S" suppresses the leading zeros. We all know how useless trailing zeros are to the right of the decimal point, right? Hint: Just about as useless as leading zeros to the left of the decimal point, right?
August 16, 2013, 05:57 AM
Wep5622
Actually, they're a bit less useless than leading zeroes. Trailing zeroes signify a certain precision in the result.

Of course, the result better actually be that accurate!


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
August 16, 2013, 09:27 AM
Doug
Yes. But, as displayed in NJSDEN's post of Thu Aug 15 2013 16:06, the lack of trailing zeros does make it much more readable. And, as long as the data is actually accurate, then the zero's are extraneous clutter which obsures the visibility of the the non-zero numbers.

To this point, I'm wondering if anyone else see's this as a valuable NFR...
August 16, 2013, 09:55 AM
David Briars
Changes in latitudes? Where is Jimmy Buffett when you need him?
DEFINE FILE GGSALES
 LATITUDE/D12.6 = DECODE SEQ_NO (1   6.21118
                                 2 12.42
                 				 3  5.0000000
                                 4  1.01
								 5  12345.012
                                );
 LATITUDE_A15/A15 = FTOA(LATITUDE, '(D12.6)', 'A15');
 LATITUDE_RJ/A15  = RJUST(15, LATITUDE_A15, 'A15');
 LATITUDE_TRIM/A15 = TRIM('T', LATITUDE_RJ, 15, '0', 1, LATITUDE_TRIM);
END
TABLE FILE GGSALES
PRINT SEQ_NO
      LATITUDE
	  LATITUDE_A15
	  LATITUDE_RJ
	  LATITUDE_TRIM
IF SEQ_NO FROM 1 TO 5
ON TABLE SET ONLINE-FMT STANDARD
END
-EXIT  

1 PAGE     1
  
  
  Sequence#       LATITUDE  LATITUDE_A15     LATITUDE_RJ      LATITUDE_TRIM     
  ---------       --------  ------------     -----------      -------------     
          1       6.211180       6.211180           6.211180         6.21118 
          2      12.420000      12.420000          12.420000        12.42    
          3       5.000000       5.000000           5.000000         5.      
          4       1.010000       1.010000           1.010000         1.01    
          5  12,345.012000  12,345.012000      12,345.012000    12,345.012   
  

August 16, 2013, 10:10 AM
susannah
DEFINE FUNCTION BUFFET ...
Cool




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 16, 2013, 11:18 AM
Prarie
Cool
August 16, 2013, 01:45 PM
Doug
LOL / Love the DEFINE FUNCTION BUFFET...

"LATITUDE_TRI" is nice. But I Want A Format... maybe a NFR? Smiler