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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decimal places in Formulas

Status
Not open for further replies.

DanCCC

Technical User
Aug 9, 2002
25
US
Hey all,

I have a DistinctCount function that returns a number with two decimal places. Of course, I want no decimals since this is a count.

I looked in CR help and found the Round function, and changed my formula look like this:

Round (DistinctCount ({CONTACT1.CONTACT}),0)

But it still returns a number with 2 decimal places. What am I doing wrong? Is "Round" the function I want to use anyway?

Thanks in Advance,

Dan Lee

 
Round changes the underlying value. You are trying to change the format, not the value. Simply click on the number and use the increase/decrease decimal buttons on the tool bar. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Ken,

Thanks. I obviously had not figured out what all the buttons were yet.

But here's one more twist: I have a text box with the formula embedded. When I click on that, I don't have such a choice b/c I'm clicking on a text box instead of just a number. Is there a way, when building the formula, to specify no decimal places?

Dan
 
DanCCC,

Embedded objects are finicky. Right click the object and select edit. Right click it again and select Format{Fieldname} (the fieldname of your embedded object), which is about 4 or 5 choices down on your list of options after your second right click.

You can then format the embedded object as you see fit. Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
You don't have to specify anything in the formula itself. You can click on the formula and reformat it to decrease the decimals, THEN embed it in the text box.
 
You an only control the format in the formula if you use the ToText function.

Much easier to format a number before you put it into the text, but you can still change the format after it is embedded. You have to get the text object into 'edit' mode by double clicking on it. Then you highlight the field within the text. From here you can use the Format menu, or right click and format the field. You can't use the toolbar buttons anymore but you can still set the decimals in the format options. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top