There are some methods for converting double to int : toInt() , round() , ceil() , and floor() . All of those methods return int . toInt() and truncate() work by truncating the decimal value. round() returns the closest integer.
There are some methods for converting double to int : toInt() , round() , ceil() , and floor() . All of those methods return int . toInt() and truncate() work by truncating the decimal value. round() returns the closest integer.