float f = 55.6; int i = Math.round(f); // Will be 56This is the simplest way, but not the best:
int i = (float)f;You can make your own round like this:
int i = (float)f + .5f; // Homemade round, use read Math.round() to be clearIf you don't want to round you can also do:
int i = Math.ceil(f); int i = Math.floor(f);