Mathf.Round ? [C#]

Hey everybody !
I’m trying to round a float without decimals with :
Mathf.Round(float f);

But it return, for exemple, 10.8.
Some one know how I can get just 10 ? (or 11)

Thanks you, bye,

  • Mathf.Floor() rounds down
  • Mathf.Ceil() rounds up
  • Mathf.FloorToInt() rounds down and returns int
  • Mathf.CeilToInt() rounds up and returns int
  • or you can just cast it to integer like this: int i = (int) f;


float myFloat = 10.8f;

int myInt = Mathf.RoundToInt(myFloat);