Link to home
Start Free TrialLog in
Avatar of arie_ben
arie_ben

asked on

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

Avatar of bdreed35
bdreed35
Flag of United States of America image

I typically use the ToText function, the Crystal counterpart to Cstr.

ToText({Class.ClassID},0,"") + " " + {Class.ClassDescription}
ASKER CERTIFIED SOLUTION
Avatar of bdreed35
bdreed35
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of arie_ben
arie_ben

ASKER

Yes this works.
Just to know CStr(Number, number decimals , seperator)
is this right?

(thanks for your quick answer, amazing!)
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

Thanks a lot.
Lots of time gain here...
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.
thanks bdreed35, I'll check it.