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
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.
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.