Group Name Formula Editor: problem with int formating

Hello,
I'm trying to customize a group Name like this:

CStr({Class.ClassID})+ " " +{Class.ClassDescription}

where ClassID is an Integer and ClassDescription a string.

Problem: the CStr({Class.ClassID}) expression returns "2.00"
so I get:
 "2.00 Women pents"
 "3.00 Men hats" etc...

instead of
 "2 Women pents"
 "3 Men hats"

how do I get the integer to be formated with no decimals?

Thanks

arie_benAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
bdreed35Connect With a Mentor Commented:
I looked up CStr and it works the same as ToText:

CStr({Class.ClassID},0,"") + " " + {Class.ClassDescription}
0
 
bdreed35Commented:
I typically use the ToText function, the Crystal counterpart to Cstr.

ToText({Class.ClassID},0,"") + " " + {Class.ClassDescription}
0
 
arie_benAuthor Commented:
Yes this works.
Just to know CStr(Number, number decimals , seperator)
is this right?

(thanks for your quick answer, amazing!)
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
ebolekCommented:
bdreed is exactly right

CStr(367.4999,0)

Returns "367".

CStr(367.5000,0)

Returns "368".

When you use 0 it rounds the integer. I dont think in your  case it will create a problem but just to let you know

Regards
Emre

0
 
arie_benAuthor Commented:
Thanks a lot.
Lots of time gain here...
0
 
bdreed35Commented:
arie_ben - Yes, that is correct.  Check out the CR Help files on how to use ToText or Cstr.  There is a wealth of different ways to use it that give you alot of control when converting non Text data into Text.
0
 
arie_benAuthor Commented:
thanks bdreed35, I'll check it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.