Print Page | Close Window

Rounding Down to nearest Hundred

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22736
Printed Date: 28 Apr 2024 at 12:21pm


Topic: Rounding Down to nearest Hundred
Posted By: GPDJJ
Subject: Rounding Down to nearest Hundred
Date Posted: 26 Feb 2019 at 12:40pm
How would I setup a formula to always round down to the nearest hundred? The built-in Rounding always rounds to nearest 100 high or low. Thanks.

So 199 would be 100, 1553 would be 1500 and 141 would be 100 etc. etc..



Replies:
Posted By: kevlray
Date Posted: 27 Feb 2019 at 4:21am
You should be able to set the number of places you want to round with the Round() function.  If you always want to 'round down', then use the truncate function.


Posted By: Lord Yorkshire
Date Posted: 04 Mar 2019 at 12:00am
If you use this

round (xxxxx)-50

then in your format field, do a customisation on the rounding to 100

That should work


Posted By: DBlank
Date Posted: 05 Mar 2019 at 3:17am

I believe you can also use MRound({field},100)
EDIT:
Sorry missed the rounding DOWN part for some reason...
MRound would not work for you. As others already indicated Truncate or Floor would work


Posted By: Valert16
Date Posted: 05 Mar 2019 at 10:06pm
Using Truncate with -2 as second parameter gives you the results you want:
Truncate (1410, -2) returns 1400
Truncate (199, -2) returns 100
Truncate (141, -2) returns 100
etc.



Print Page | Close Window