- Home /
Nothing after the dot (1.051 = 1) for float
Hello, I want remove number after the dot in a float like (it's an example) 1.021 to get 1. How can i do that?
Comment
Best Answer
Answer by AndyMartin458 · Jun 17, 2014 at 08:28 PM
You can do that.
int num = Mathf.FloorToInt(1.021f);
Your answer
Follow this Question
Related Questions
invalid format exception when parsing float 2 Answers
Split a number? 1 Answer
Unity3D editor not allowing large floats as input 1 Answer
Change a float smooth 2 Answers
Float, make percentage 1 Answer