Focal Point
[SOLVED] Floating Decimal

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

July 09, 2010, 02:50 PM
Prasad
[SOLVED] Floating Decimal
In my report, i am printing values for production with the format "P20.2C"...
I get the out put with two decimals and coma seperated...example :
23.20
23,000.13
20,000.00

The requirement asks decimals only if there is demimal values like ".02" or ".16"...
other wise just the values without ".00"....

Can you help me guys...

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


7.7.02, sql server
Windows
all output (Excel, HTML, PDF)
July 09, 2010, 02:56 PM
Darin Lee
Multiple examples of this on the forum. Try searching for "dynamic format."


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
July 09, 2010, 04:04 PM
njsden
This might help:

DEFINE FILE CAR
TOT_SALES/P20.2 = SALES * 1.272;
FMT_SALES/A8 = IF INT(TOT_SALES) EQ TOT_SALES THEN 'P20C' ELSE 'P20.2C';
END
TABLE FILE CAR
PRINT TOT_SALES AS 'Actual,Value'
      TOT_SALES/FMT_SALES AS 'Formatted,Value'
BY COUNTRY AS 'Country'
BY CAR     AS 'Car'
END




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.
July 09, 2010, 04:32 PM
Darin Lee
You're too kind. I was letting the user figure out a little bit for themselves - having to expend a little effort helps them remember it better the next time.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
July 09, 2010, 05:15 PM
njsden
Point taken and agreed upon, Darin. Smiler

quote:
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.


Best,
- Neftali.



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.
July 12, 2010, 03:40 AM
Tony A
quote:
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
I prefer the version I posted a while back.

Give a man a fish and he'll eat well for a day, give him a boat and fishing rod and he'll sit in the boat all day drinking beer. Wink

T



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 
July 12, 2010, 07:13 AM
<JG>
How come you know my favorite pastime?
July 12, 2010, 03:10 PM
Prasad
Thank You guys very much....


7.7.02, sql server
Windows
all output (Excel, HTML, PDF)