vb.net – VB2010如何判断数字是否为整数

前端之家收集整理的这篇文章主要介绍了vb.net – VB2010如何判断数字是否为整数前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我需要能够判断整数是一个整数还是有小数.因此13将是整数,23.23将是小数.

所以喜欢;

  1. If 13 is a whole number then
  2. msgBox("It's a whole number,with no decimals!")
  3. else
  4. msgBox("It has a decimal.")
  5. end if
  1. If x = Int(x) Then
  2. 'x is an Integer!'
  3. Else
  4. 'x is not an Integer!'
  5. End If

猜你在找的VB相关文章