Rounding Down to nearest Hundred
Printed From: Crystal Reports Book — Forum Name: Technical Questions
Posted By: GPDJJ — 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.. Edited by GPDJJ - 26 Feb 2019 at 1:19pm
Posted By: kevlray — 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 — 4 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 — 5 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
Edited by DBlank - 06 Mar 2019 at 2:36am
Posted By: Valert16 — 5 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.
|