Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Group Name Formula Editor: problem with int formating

Posted on 2004-09-09
Medium Priority
Last Modified: 2012-08-13
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?


Question by:arie_ben
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 28

Expert Comment

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

ToText({Class.ClassID},0,"") + " " + {Class.ClassDescription}
LVL 28

Accepted Solution

bdreed35 earned 500 total points
ID: 12019759
I looked up CStr and it works the same as ToText:

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

Author Comment

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

(thanks for your quick answer, amazing!)
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

LVL 10

Expert Comment

ID: 12019811
bdreed is exactly right


Returns "367".


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



Author Comment

ID: 12019835
Thanks a lot.
Lots of time gain here...
LVL 28

Expert Comment

ID: 12019842
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.

Author Comment

ID: 12019863
thanks bdreed35, I'll check it.

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question