Floor Function in ColdFusion is Int

Updated , First Published by Pete Freitag

Those of you coming from programming languages that have a floor function, may be hard pressed to find it in ColdFusion - that's because it's called Int.

The Int function will take in a floating point number chop off the decimal part, leaving you with just the integer part.

For example:

#Int(5.2)# = 5
#Int(2.9)# = 2

Update: ColdFusion 2016+ and Lucee 5.1+ now implement the floor() function in CFML.

The Fixinator Code Security Scanner for ColdFusion & CFML is an easy to use security tool that every CF developer can use. It can also easily integrate into CI for automatic scanning on every commit.