In PostgreSQL, the floor()
function is used for rounding a number down to the nearest integer.
It’s basically the opposite of ceiling()
, which rounds a number up.
It’s also similar to round()
, except that it only rounds down. The round()
function will round up or down as required.