Solved

Group Name Formula Editor: problem with int formating

Posted on 2004-09-09
7
414 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
[X]
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
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
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

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

756 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