❔ Truncate
how do I Truncate a float to an int, I tried this
and it says
I really need to know how to truncate now
4 Replies
actually
per docs
Convert.ToInt32()
rounds
so, you'd have to truncate first
better yet
Oh, converttoint, why didn’t I think of that
¯\_(ツ)_/¯
I believe you can also just cast
yeah, you can
and it does truncate as well
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.