Solved

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

Posted on 2004-04-09
5
314 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
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…

861 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

23 Experts available now in Live!

Get 1:1 Help Now