In Apex, the intValue() method is used to return the Integer value of this Decimal.
intValue()
Decimal d1 = 12.12; System.debug(d1.intValue());
Output: 12