Solved

Group Name Formula Editor: problem with int formating

Posted on 2004-09-09
7
410 Views
Last Modified: 2012-08-13
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

0
Comment
Question by:arie_ben
  • 3
  • 3
7 Comments
 
LVL 28

Expert Comment

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

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

Accepted Solution

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

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

Author Comment

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

(thanks for your quick answer, amazing!)
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 10

Expert Comment

by:ebolek
ID: 12019811
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
 

Author Comment

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

Expert Comment

by:bdreed35
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.
0
 

Author Comment

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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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. …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now