- Home /
Hiding decimals without using Mathf.Round?
I can't use Mathf.round because it rounds up after 0.5. I dont want it to round up but show the real float value without decimals. How can this be done? :) I have a slider with a float value from 1 to 10 and I want the string to go "1,2,3,4".. I'm using C# too btw :)
Comment
Best Answer
Answer by KoenigX3 · Jan 15, 2017 at 06:26 PM
In this case you should use Mathf.Floor(), which will round it down to the nearest integer.
Answer by Creeper_Math · Jan 15, 2017 at 08:49 PM
You say that you're using a slider.. You know that you can set the slider to "Whole Numbers"
ui-sliderinspector-ink-li.jpg
(132.8 kB)
I already tried that and it does not work. The slider value does not update at all..