java float to int code example
Example 1: android studio float to int
int i = Math.round(f); // f a float
Example 2: java convert float to int
int a = (int)float1
Example 3: float to int in java
Using Math.round() will round the float to the nearest integer.
Example 4: convertir un float en int en java
int bob = (int) 3.14; \\ bob = 3