How do I round a float upwards to the nearest int in C#?

后端 未结 6 1073
悲哀的现实
悲哀的现实 2020-12-08 09:43

In C#, how do I round a float upwards to the nearest int?

I see Math.Ceiling and Math.Round, but these returns a decimal. Do I use one of these then cast to an Int?<

6条回答
提交回复
热议问题