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

trailing zero's in formula 1

Status
Not open for further replies.

jel

Programmer
Feb 17, 2002
349
NL
Sorry if this is a dumb question, bit I'm new to Crystal and I need to produce some working reports on short notice...
If I use 'PageNumber' in a formula, I always get it like:
'7.00'
I tried functions like Round() and ToString(), but I seem to be missing something.
 
Hi Jel,
I'm not sure why this is happening for you but to set the decimal style in your report, right click on the 'PageNumber' field and click on Format Field. Go to the number tab and customize and set the decimal style.
Jacque
 
You are getting "7.00" because this is how your "number" is set to show up. To remove the zeros from this field just right click on the field > format field > number > select the appropriate type.

Hope this helps!

Kchaudhry
 
You can also set the defaults for future reports by going to
File -> Options -> Fields -> Number
and using Customize to set your preferred format. This should then be the default for all Number fields.

John
 
Thanks, but if I just add 'Page Number'from the Fields-explorer, it prints "7" allright.
However if I make a formula like
'you are on page ' & PageNumber & 'now'
it prints:
you are on page 7.00 now



 
Well one of doing what you are tyring to do is to:

Place the page number field from the explorer anywhere on you report. Add a text box in the desired location. Then click and drag and drop the "page number" field in between the text box.

This should solve your problem.

Kchaudhry
 
Oops I should have mentioned:

Type "you are on page now" in the text box. Click and drag the page number field and drop it after "page" in the text box.

Kchaudhry
 
Yes, I see what you mean.
But what I realy want to di is just concatenate a string and an integer-number.
I mean: you could have a formula like
{adressNumber} + ' ' + {adressStreet}
and you want to end up with
'23.00 CrystalRoad', don't you?
 
Yes, but I dont see a reason why you would use a formula for this. You can just perform field concatenation by adding your field in the text box. This is always simpler and easier and you dont have to use any extra code to do the conversions.

Kchaudhry
 
Yes, you're right.
It works in all the situations I have to deal with right now, thanks for your patience.
I'm just a bit too hasty, wanting to learn all the possibilities of formula's etc within 15 minutes...

 
To correct address numbers or any number as you described, I use the formula - ToText({Table.StreetNumber},0,"")
 
If you want to use a formula, you can do it like this:

ToText({adressNumber},0) + ' ' + {adressStreet};


~Brian
 
Well if it is just a matter of exploring then you can always use the "ToText" option. I have used that in the past to convert strings.


Kchaudhry
 
Thanks guys,

that was what I was looking for initialy...
But Kchaudhry's post was even more helpfull as I just overlooked the obvious.
Thanks all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top