Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Round / Truncate 1

Status
Not open for further replies.

keijen

Programmer
Jul 12, 2001
16
AU
Why does this return me 24.00 and not just 24?

if Count ({divisions.divname})> 0
then "For all divisions there are " & truncate(Count({divisions.divname}),0) & " projects"

The Count({divisions.divname}) is a summary in the report footer. The values are correct, I just want to truncate the value.

I've done totext(truncate(count({fname}),0)), tried 'fix' and others.

I'm not getting it, am I? What must I do?
 
Have you tried ToText(count(fname),0)

This is generally what I use to strip the decimals off of numerics when I print them
 
That's an excellent workaround, AMurdoch! I wish I had thought of it a while back...

I had this problem for a while, and, after banging my head on the desk for a week and two hours on hold with Crystal support, I was told something to the effect of the following:

BEFORE you create the report, you MUST, in the 'options'/'report options', set how you want numbers to display throughout the report. Only in this way can you change how numbers will display in a field that also contains text (ie- you can't change it once it's created if it's a mixed field, such as the one described in this post). If your field displayed numeric values only, then you could choose 'format field' -> 'number' and choose the format for numbers to display. There is no such choice with mixed fields, of course, and the 'report options' (at least some of the options) will have no effect once the report is created.

This is from the mouth of CrystalDecisions support. It didn't make much sense to me why changing 'report options' would not affect the fields already present in a report. If I misunderstood and this info is incorrect, please let me know. -rodbac
 
Thanks to you both - CAREFUL reading of the Help file for ToText does indicate the function will work stand-alone. I should have picked it out.

I had stuck in the truncate/round mindmode and .....?

Grateful!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top