Formatting Decimal to an Integer

I have a decimal and I want to convert it to an integer. How do I go about that?
3 answers

You can youse three mathematical functions in the expressions, based on your requirement…

floor – Rounds down to an integer (returns the largest integer which is less than or equal to the input).

ceil – Rounds up to an integer (returns the smallest integer which is greater than or equal to the input).

round – Rounds a number to a certain precision. Precision needs to be passed as an argument.


look here :

You can use the function round()


you can use any of the function floor ceil and round, as they takes decimal and gives back integer, but the value changes as they have their own use  case study what it does to the  decimal you give an use it according to your requirement.