How to remove decimal part from a number in C#

后端 未结 7 770
予麋鹿
予麋鹿 2020-12-08 04:12

I have number of type double. double a = 12.00 I have to make it as 12 by removing .00

Please help me

7条回答
  •  既然无缘
    2020-12-08 04:34

    Because the numbers after point is only zero, the best solution is to use the Math.Round(MyNumber)

提交回复
热议问题