Solved

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

Posted on 2004-04-09
5
313 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
incendius,

So was your formula working before?


Pete
0
 

Author Comment

by:incendius
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

15 Experts available now in Live!

Get 1:1 Help Now