Round a Floating Point Number Down to the Nearest Integer?

Anthony Perez picture Anthony Perez · Jun 17, 2013 · Viewed 349.7k times · Source

As the title suggests, I want to take a floating point number and round it down to the nearest integer. However, if it's not a whole, I ALWAYS want to round down the variable, regardless of how close it is to the next integer up. Is there a way to do this?

Answer

Ghostwriter picture Ghostwriter · Jun 17, 2013

Simple

print int(x)

will work as well.