- Home /
Is it possible to round down 0.99 to 0?
Hey guys! I was wondering if it was possible to round down numbers by just stripping of the decimal places of it. 0.75->0 , 5.1 -> 5 etc. Maybe it'd be possible by converting floats to ints, but I don't know what method is used there. If it uses the usual round to closest method or if it strips of the decimal places. Thanks for you time
David
Answer by j0ffe · Dec 01, 2012 at 05:45 PM
http://bytes.com/topic/c-sharp/answers/250732-math-round-down
Should work the same way except that in unity it's mathf instead of math.
riiight, I knew I saw it somewhere..oh stupid me. Anywas, thanks for the answer.
Actually it's "in addition to", not ins$$anonymous$$d of. You can use System.$$anonymous$$ath if you want. (And I do when it comes to Sign, since the $$anonymous$$athf version I consider bugged.)
Your answer
Follow this Question
Related Questions
Float to Int 4 Answers
How to round or convert doubles? 2 Answers
"bleeding" when using configurable joints 2 Answers