Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Rounding Down to nearest Hundred Post Reply Post New Topic
Author Message
GPDJJ
Newbie
Newbie


Joined: 07 May 2018
Online Status: Offline
Posts: 6
Quote GPDJJ Replybullet Topic: Rounding Down to nearest Hundred
    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..

Edited by GPDJJ - 26 Feb 2019 at 1:19pm
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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.
IP IP Logged
Lord Yorkshire
Newbie
Newbie
Avatar

Joined: 04 Jul 2010
Online Status: Offline
Posts: 28
Quote Lord Yorkshire Replybullet 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
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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


Edited by DBlank - 06 Mar 2019 at 2:36am
IP IP Logged
Valert16
Groupie
Groupie
Avatar

Joined: 21 Mar 2016
Location: Spain
Online Status: Offline
Posts: 57
Quote Valert16 Replybullet 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.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.