|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Code:
If IsNumeric("6d6") Then
MsgBox ("IsNumeric")
Else
MsgBox ("Not IsNumeric")
End If
Why is the string "6d6" numeric? Could someone please explain? |
|
#2
|
||||
|
||||
|
because the character "e" inside number is meaningfull and means:
multiply the number before that character in 10 power the number after that character. and for some reason which I still don't know, "d" has the same meaning exactly. thus, 6e1 is 6*10=60, 6e2 is 6*(10^2)=6*100=600 etc... pretty unique situation, how did you stumble upon it? anyhow, you can "solve" this by manually checking the string for "d" or "e" characters. |
|
#3
|
|||
|
|||
|
Very strange indeed
![]()
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#4
|
||||
|
||||
|
This was one of the questions in the MCIWD ASP Exam
![]() isNumeric("6d6") a. true b false I have just learnt that I got it wrong. (I would have got 6e6) |
|
#5
|
||||
|
||||
|
wow they're plain evil in those Exams.... I had no clue about all this until I saw this post.
|
|
#6
|
||||
|
||||
|
Quote:
They are evil. Although it is only the Sun Certified Java Programmer where you come out of the exam room safe in the knowledge that the examiners deeply and personally hate you. |
|
#7
|
|||
|
|||
|
I was doing tests with my component and I randomly typed 6d6 just to make sure all validations were working fine and I had this strange surprise...
At least it wasn't the client who stumbled upon this ![]() |
|
#8
|
||||
|
||||
|
Quote:
) |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > IsNumeric("6d6") = True ???? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|