Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Vivek Patel   on Aug 03 In Asp.net Category.

  
Question Answered By: Lughaidh Fischer   on Aug 03

I think IsNumeric( ) will handle doubles as well - I don't think it requires
an integer to return true.... for example - this test page will print out
"we equal" if b is equal to "23.123" or "23" (same as if a is equal to
23.123 or 23) -- if you pop a character in the string  for b, then "we not
equal" gets printed....


<%@ Page Language="vb" AutoEventWireup="false" %>
<html>
<head>
<SCRIPT runat=server>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim a as double  = 23.123
Dim b as string = "23.123"
If IsNumeric(a) and IsNumeric(b) Then
Response.Write("we equal")
Else
Response.Write("we not equal")
End If
End Sub
</SCRIPT>
</head>
<body>
</body>
</html>

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Math function to determine if a number is an int Or get search suggestion and latest updates.


Tagged: