Solved

Possible to round up in Crystal Reports when the number isn't > 5???

Posted on 2004-04-09
5
317 Views
Last Modified: 2012-06-22
Ok I am completely stumped. I have a bunch of fields that need to br rounded to the nearest whole number, even when they are less than... meaning:

1.45
1.76
3.06
5.25

I need ANY numbers who has ANYTHING in the tenths/hundredths to be rounded UP.
So basically what I want to acheive is:

2
2
4
6

This is because the numbers represent a piece of material to be used. If it calls for "3.06", we need to use 4 to get the job done. The current formula is:

{@SumTotal} + ( {@SumTotal} * ({tbl Material.Waste} / 100 ) )

Is this possible to do? Can I round up anything in .xx to the next whole number?

Much thanks in advance for your help!

0
Comment
Question by:incendius
[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
  • 2
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
stasau earned 250 total points
ID: 10791271
Create a formula with code like:

if Remainder ({tblLengths.BoardLength},1) = 0 then
    {tblLengths.BoardLength}
else
    truncate({tblLengths.BoardLength}) + 1

Obviously, you would replace {tblLengths.BoardLength} with your fieldname.
0
 
LVL 77

Expert Comment

by:peter57r
ID: 10791279
Hello incendius,

I am assuming that you want to round your current formula.

int({@SumTotal} + ( {@SumTotal} * ({tbl Material.Waste} / 100 ) )+0.999)



Pete
0
 

Author Comment

by:incendius
ID: 10791414
OK ummm.. I tried both posible solutions and the code wanted to save with error each time.

{@SumTotal} + ( {@SumTotal} * ({tbl Material.Waste} / 100 ) )

^--- is what I have currently... any ideas on how to make your ideas work? I know basically nothing about CR.

Thanks!
0
 
LVL 77

Expert Comment

by:peter57r
ID: 10791955
incendius,

So was your formula working before?


Pete
0
 

Author Comment

by:incendius
ID: 10792090
Sweeet! Thanks for the help guys... Stasau's answer worked just right.

All I had to do was replace 'tblLengths.BoardLength' with '@SumTotal'.

Awesome.

0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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