Force a float into an integer value

Very easy and quick question.

I want characters to increment a 10% of their current health when leveling up. Sometimes that number is not an integer (I need them to be integer for something very important). Can I make it take the 10% of the number and force that number to take an equivalent as an int number?

Thanks in advance

float aFloat = 5.125f;
int aInt = (int)aFloat;
1 Like
float aFloat = 5.615f;
int aInt = Mathf.FloorToInt(aFloat); // 5
aInt = Mathf.RoundToInt(aFloat); // 6
aInt = Mathf.CeilToInt(aFloat); // 6
1 Like