Group Name Formula Editor: problem with int formating

Posted on 2004-09-09
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
  • 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 125 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!)
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Reports  Formula to Command 4 83
String to Date Formula Failure 2 49
Select Cross-tab total 2 62
Crystal Report sorting 6 11
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

803 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