Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Percent Operator & Decimal Places

Status
Not open for further replies.

EndersG

Programmer
Mar 30, 2001
9
US
I use the percent operator for a customized formula field to give me the percent of two values. However, the results give me trailing decimal places which I do not want. For example, let's say x = 13 and y = 17. The formula field with the percent operator (x % y) gives me 76.47%. I only want 76%. I can convert the formual field to text (using ToText) and then append the string "%" to give me the final result, however, this method will convert the whole field to string and I want it to remain a numeral. I need it to remain a numeral because there will be subsequent calcultions made based on this formula field. Does anyone out there have a quick and easy way to use the percent operator but just eliminate any trailing decimal places. Any help will be greatly appreciated.
 
Format the field (where you drop it in the report) to have no decimals.
 
There are increase/decrease decimal buttons on the toolbar, to the right. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top