Solved

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

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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