floor method

int? floor()

Returns the greatest integer no greater than this number.

Rounds the number towards negative infinity.

Throws an UnsupportedError if this number is not finite (NaN or infinity).

print(Obj(1.99999).floor()); // 1
print(Obj(2.0).floor()); // 2
print(Obj(2.99999).floor()); // 2
print(Obj(-1.99999).floor()); // -2
print(Obj(-2.0).floor()); // -2
print(Obj(-2.00001).floor()); // -3

Implementation

int? floor() => value?.floor();