Re: IsNumeric not returning correctly
- From: "Bob Butler" <tiredofit@xxxxxxxxxx>
- Date: Wed, 8 Feb 2006 09:55:54 -0800
"Robert Morley" <rmorley@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ejH$SYNLGHA.3276@xxxxxxxxxxxxxxxxxxxx
This is a special case. IsNumeric will correctly interpret scientific
notation, or VB's version of it, so 1E6 gets interpreted as 1,000,000
(1 * 10 ^ 6). Since that's numeric, IsNumeric returns True.
The only way I can think of to get around this is to do something
like this:
Private Function IsReallyNumeric(ByVal s as String)
As Boolean
IsReallyNumeric = IsNumeric(Replace(s,"e","z"))
End Function
You'd have to replace "d" as well and make the replace case-insensitive
since D and E are also 'numeric' in these cases. And while the problem is
the same in both VB and Visual Fred the syntax for the solution is going to
be different which is why the question should be asked in the right
newsgroup.
--
Reply to the group so all can participate
VB.Net: "Fool me once..."
.
- Follow-Ups:
- Re: IsNumeric not returning correctly
- From: Robert Morley
- Re: IsNumeric not returning correctly
- References:
- Re: IsNumeric not returning correctly
- From: Robert Morley
- Re: IsNumeric not returning correctly
- Prev by Date: Re: IsNumeric not returning correctly
- Next by Date: New in quality measurement of VB6 software
- Previous by thread: Re: IsNumeric not returning correctly
- Next by thread: Re: IsNumeric not returning correctly
- Index(es):