Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27382

Identify if number is integer or decimal ?

$
0
0
Hi. I need to know, how I can identify if a number is Integer (i.e.: 5,10,16,466,12350) or Decimal (i.e.: 4.25, 10.126666666) ?

I tried this:
vb.net Code:
  1. Dim numar = TextBox1.Text
  2.         If TypeName(numar) = "Integer" Then
  3.             Label1.Text = "The number is integer"
  4.         ElseIf TypeName(numar) = "Decimal" Then
  5.             Label1.Text = "The number is DecimaL"
  6.  
  7.         End If
but isn't working, label1.text are remaining "Label1"...

Viewing all articles
Browse latest Browse all 27382


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>