How do I convert a decimal to an int in C#?

后端 未结 12 2431
再見小時候
再見小時候 2020-12-02 13:47

How do I convert a decimal to an int?

12条回答
  •  無奈伤痛
    2020-12-02 14:41

    decimal vIn = 0.0M;
    int vOut = Convert.ToInt32(vIn);
    

    Here is a very handy convert data type webpage for those of others. http://www.convertdatatypes.com/Convert-decimal-to-int-in-CSharp.html

提交回复
热议问题