FLOOR in Crystal Report

CR 9

i need to round down to the nearest whole number.  how can i do this?

thanks.
LVL 44
zephyr_hex (Megan)DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

musalmanERP ConsultantCommented:
If your field is numeric, Right Click the Field and Click Format Field > Click Customize > Click Rounding Drop Down and then select what level you want :)
0
mlmccCommented:
CR XI has the FLOOR function.  Is it not in CR9?

Here is one method

Round({yourNumber} - 0.5)

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlmccCommented:
ANother idea is there a Trunc or Truncate in CR9?

mlmcc
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

zephyr_hex (Megan)DeveloperAuthor Commented:
@musalman: this can not be a format as i need to use the result in a calculation.

@mlmcc: CR 9 does not seem to have FLOOR() ... i get an error when i try to use it.  i will try your suggestions, and check for a truncate function.
0
James0628Commented:
 mlmcc,

 CR 10 doesn't have Floor either.  They must have added it in CR XI.


 zephyr_hex,

 CR 10 has Truncate (aka Fix) and Int.  They both just drop the decimals completely.  For example, 1.999 becomes 1.  But Truncate and Int handle negative numbers differently.  For example, Truncate (-10.2) gives you -10, while Int (-10.2) gives you -11.

 James
0
musalmanERP ConsultantCommented:
Another good function that may help you , (If Exists in CR 9) is Fix().
It Returns a truncated value.

e.g.
Fix (number), Fix (number, #places)


0
zephyr_hex (Megan)DeveloperAuthor Commented:
i do not expect to encounter negative numbers.
Round({yourNumber} - 0.5)
and
truncate()
and
fix()
all seem to do the job.

thanks
0
James0628Commented:
You're welcome.  Glad I could help.

 James
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.