Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Round Down

Status
Not open for further replies.

mellicks

Programmer
Aug 27, 2008
11
US
Hello. I have a formula and I have the result as a whole number. I always need the result to round down, not up to the next whole number. How do I do that? I can only get it to round up to the next whole number.

For example, if my result is 120.67 then I want it to say 120, not 121.

Thanks,
mellicks
 
Sorry, forgot to mention I'm using crystal XI version.
 
Just use the int() function

so int(120.67) or int(<equation>)

 
use floor

floor(4.9,1) = 4
floor(4.1,1) = 4

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
int will work fine but if you choose to use that method you might want to consider substituting truncate for int if you ever expect to have negative numbers.

int(120.67) = 120
int(-120.67) = -121
truncate(-120.67) = -120

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top