viusal basic input validation integer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • code_wrong

    #16
    Re: visual basic input validation integer


    "code_wrong " <tac@tac.co.u k> wrote in message
    news:4404ac4c$1 _3@mk-nntp-2.news.uk.tisca li.com...[color=blue]
    > Visual Basic (not dot net)
    > what is the best way to check the User has entered an integer into an
    > InputBox?
    >
    > isNumeric() checks for a numeric value .. but does not notify of numbers
    > with decimal places
    > inputBox returns a string so I could check for decimal point??? this seems
    > like overkill
    >
    > The value returned can be asigned into an Integer type and then a Single
    > type ... the two can be compared .. but still this does not complain about
    > numbers with decimal places if the fractional part is zero
    >
    > what is the simple solution?[/color]

    Interesting discussion , thanks for the replies.
    I have decided to provide students with a pre-defined function of my own
    design
    please review and improve if you can
    the function:

    Function isInteger(strVa l As String) As Boolean

    'if not numeric or decimal point found
    If Not IsNumeric(strVa l) Or InStr(strVal, ".") Then
    isInteger = False
    Else
    isInteger = True
    End If

    End Function



    Comment

    • code_wrong

      #17
      Re: visual basic input validation integer


      "code_wrong " <tac@tac.co.u k> wrote in message
      news:4404ac4c$1 _3@mk-nntp-2.news.uk.tisca li.com...[color=blue]
      > Visual Basic (not dot net)
      > what is the best way to check the User has entered an integer into an
      > InputBox?
      >
      > isNumeric() checks for a numeric value .. but does not notify of numbers
      > with decimal places
      > inputBox returns a string so I could check for decimal point??? this seems
      > like overkill
      >
      > The value returned can be asigned into an Integer type and then a Single
      > type ... the two can be compared .. but still this does not complain about
      > numbers with decimal places if the fractional part is zero
      >
      > what is the simple solution?[/color]

      Interesting discussion , thanks for the replies.
      I have decided to provide students with a pre-defined function of my own
      design
      please review and improve if you can
      the function:

      Function isInteger(strVa l As String) As Boolean

      'if not numeric or decimal point found
      If Not IsNumeric(strVa l) Or InStr(strVal, ".") Then
      isInteger = False
      Else
      isInteger = True
      End If

      End Function



      Comment

      • Rick Rothstein [MVP - Visual Basic]

        #18
        Re: visual basic input validation integer

        > I have decided to provide students with a pre-defined function of my own[color=blue]
        > design
        > please review and improve if you can
        > the function:
        >
        > Function isInteger(strVa l As String) As Boolean
        >
        > 'if not numeric or decimal point found
        > If Not IsNumeric(strVa l) Or InStr(strVal, ".") Then
        > isInteger = False
        > Else
        > isInteger = True
        > End If
        >
        > End Function[/color]

        From a previous post of mine...

        I usually try and steer people away from using IsNumeric to "proof"
        supposedly numeric text. Consider this (also see note below):

        ReturnValue = IsNumeric("($1, 23,,3.4,,,5,,E6 7$)")

        Most people would not expect THAT to return True. IsNumeric has some "flaws"
        in what it considers a proper number and what most programmers are looking
        for.

        I had a short tip published by Pinnacle Publishing in their Visual Basic
        Developer magazine that covered some of these flaws. Originally, the tip was
        free to view but is now viewable only by subscribers.. Basically, it said
        that IsNumeric returned True for things like -- currency symbols being
        located in front or in back of the number as shown in my example (also
        applies to plus, minus and blanks too); numbers surrounded by parentheses as
        shown in my example (some people use these to mark negative numbers);
        numbers containing any number of commas before a decimal point as shown in
        my example; numbers in scientific notation (a number followed by an upper or
        lower case "D" or "E", followed by a number equal to or less than 305 -- the
        maximum power of 10 in VB); and Octal/Hexadecimal numbers (&H for
        Hexadecimal, &O or just & in front of the number for Octal).

        NOTE:
        ======
        In the above example and in the referenced tip, I refer to $ signs and
        commas and dots -- these were meant to refer to your currency, thousands
        separator and decimal point symbols as defined in your local settings --
        substitute your local regional symbols for these if appropriate.

        As for your question about checking numbers, here are two functions that I
        have posted in the past for similar questions..... one is for digits only
        and the other is for "regular" numbers:

        Function IsDigitsOnly(Va lue As String) As Boolean
        IsDigitsOnly = Len(Value) > 0 And _
        Not Value Like "*[!0-9]*"
        End Function

        Function IsNumber(ByVal Value As String) As Boolean
        ' Leave the next statement out if you don't
        ' want to provide for plus/minus signs
        If Value Like "[+-]*" Then Value = Mid$(Value, 2)
        IsNumber = Not Value Like "*[!0-9.]*" And _
        Not Value Like "*.*.*" And _
        Len(Value) > 0 And Value <> "." And _
        Value <> vbNullString
        End Function

        Here are revisions to the above functions that deal with the local settings
        for decimal points (and thousand's separators) that are different than used
        in the US (this code works in the US too, of course).

        Function IsNumber(ByVal Value As String) As Boolean
        Dim DP As String
        ' Get local setting for decimal point
        DP = Format$(0, ".")
        ' Leave the next statement out if you don't
        ' want to provide for plus/minus signs
        If Value Like "[+-]*" Then Value = Mid$(Value, 2)
        IsNumber = Not Value Like "*[!0-9" & DP & "]*" And _
        Not Value Like "*" & DP & "*" & DP & "*" And _
        Len(Value) > 0 And Value <> DP And _
        Value <> vbNullString
        End Function

        I'm not as concerned by the rejection of entries that include one or more
        thousand's separators, but we can handle this if we don't insist on the
        thousand's separator being located in the correct positions (in other words,
        we'll allow the user to include them for their own purposes... we'll just
        tolerate their presence).

        Function IsNumber(ByVal Value As String) As Boolean
        Dim DP As String
        Dim TS As String
        ' Get local setting for decimal point
        DP = Format$(0, ".")
        ' Get local setting for thousand's separator
        ' and eliminate them. Remove the next two lines
        ' if you don't want your users being able to
        ' type in the thousands separator at all.
        TS = Mid$(Format$(10 00, "#,###"), 2, 1)
        Value = Replace$(Value, TS, "")
        ' Leave the next statement out if you don't
        ' want to provide for plus/minus signs
        If Value Like "[+-]*" Then Value = Mid$(Value, 2)
        IsNumber = Not Value Like "*[!0-9" & DP & "]*" And _
        Not Value Like "*" & DP & "*" & DP & "*" And _
        Len(Value) > 0 And Value <> DP And _
        Value <> vbNullString
        End Function

        Rick


        Comment

        • Duane Arnold

          #19
          Re: visual basic input validation integer

          code_wrong wrote:[color=blue]
          > "code_wrong " <tac@tac.co.u k> wrote in message
          > news:4404ac4c$1 _3@mk-nntp-2.news.uk.tisca li.com...
          >[color=green]
          >>Visual Basic (not dot net)
          >>what is the best way to check the User has entered an integer into an
          >>InputBox?
          >>
          >>isNumeric() checks for a numeric value .. but does not notify of numbers
          >>with decimal places
          >>inputBox returns a string so I could check for decimal point??? this seems
          >>like overkill
          >>
          >>The value returned can be asigned into an Integer type and then a Single
          >>type ... the two can be compared .. but still this does not complain about
          >>numbers with decimal places if the fractional part is zero
          >>
          >>what is the simple solution?[/color]
          >
          >
          > Interesting discussion , thanks for the replies.
          > I have decided to provide students with a pre-defined function of my own
          > design
          > please review and improve if you can
          > the function:
          >
          > Function isInteger(strVa l As String) As Boolean
          >
          > 'if not numeric or decimal point found
          > If Not IsNumeric(strVa l) Or InStr(strVal, ".") Then
          > isInteger = False
          > Else
          > isInteger = True
          > End If
          >
          > End Function
          >
          >
          >[/color]

          If you have tested it and it works -- it works.

          Does it need to be complicated for some reason?

          Duane :)

          Comment

          • code_wrong

            #20
            Re: visual basic input validation integer


            "Rick Rothstein [MVP - Visual Basic]" <rickNOSPAMnews @NOSPAMcomcast. net>
            wrote in message news:jN-dnUImFI79q5rZnZ 2dnUVZ_tOdnZ2d@ comcast.com...[color=blue][color=green]
            >> I have decided to provide students with a pre-defined function of my own
            >> design
            >> please review and improve if you can
            >> the function:
            >>
            >> Function isInteger(strVa l As String) As Boolean
            >>
            >> 'if not numeric or decimal point found
            >> If Not IsNumeric(strVa l) Or InStr(strVal, ".") Then
            >> isInteger = False
            >> Else
            >> isInteger = True
            >> End If
            >>
            >> End Function[/color]
            >
            > From a previous post of mine...
            >
            > I usually try and steer people away from using IsNumeric to "proof"
            > supposedly numeric text. Consider this (also see note below):
            >
            > ReturnValue = IsNumeric("($1, 23,,3.4,,,5,,E6 7$)")
            >
            > Most people would not expect THAT to return True. IsNumeric has some
            > "flaws"
            > in what it considers a proper number and what most programmers are looking
            > for.
            >
            > I had a short tip published by Pinnacle Publishing in their Visual Basic
            > Developer magazine that covered some of these flaws. Originally, the tip
            > was
            > free to view but is now viewable only by subscribers.. Basically, it said
            > that IsNumeric returned True for things like -- currency symbols being
            > located in front or in back of the number as shown in my example (also
            > applies to plus, minus and blanks too); numbers surrounded by parentheses
            > as
            > shown in my example (some people use these to mark negative numbers);
            > numbers containing any number of commas before a decimal point as shown in
            > my example; numbers in scientific notation (a number followed by an upper
            > or
            > lower case "D" or "E", followed by a number equal to or less than 305 --
            > the
            > maximum power of 10 in VB); and Octal/Hexadecimal numbers (&H for
            > Hexadecimal, &O or just & in front of the number for Octal).
            >
            > NOTE:
            > ======
            > In the above example and in the referenced tip, I refer to $ signs and
            > commas and dots -- these were meant to refer to your currency, thousands
            > separator and decimal point symbols as defined in your local settings --
            > substitute your local regional symbols for these if appropriate.
            >
            > As for your question about checking numbers, here are two functions that I
            > have posted in the past for similar questions..... one is for digits only
            > and the other is for "regular" numbers:
            >
            > Function IsDigitsOnly(Va lue As String) As Boolean
            > IsDigitsOnly = Len(Value) > 0 And _
            > Not Value Like "*[!0-9]*"
            > End Function
            >
            > Function IsNumber(ByVal Value As String) As Boolean
            > ' Leave the next statement out if you don't
            > ' want to provide for plus/minus signs
            > If Value Like "[+-]*" Then Value = Mid$(Value, 2)
            > IsNumber = Not Value Like "*[!0-9.]*" And _
            > Not Value Like "*.*.*" And _
            > Len(Value) > 0 And Value <> "." And _
            > Value <> vbNullString
            > End Function
            >
            > Here are revisions to the above functions that deal with the local
            > settings
            > for decimal points (and thousand's separators) that are different than
            > used
            > in the US (this code works in the US too, of course).
            >
            > Function IsNumber(ByVal Value As String) As Boolean
            > Dim DP As String
            > ' Get local setting for decimal point
            > DP = Format$(0, ".")
            > ' Leave the next statement out if you don't
            > ' want to provide for plus/minus signs
            > If Value Like "[+-]*" Then Value = Mid$(Value, 2)
            > IsNumber = Not Value Like "*[!0-9" & DP & "]*" And _
            > Not Value Like "*" & DP & "*" & DP & "*" And _
            > Len(Value) > 0 And Value <> DP And _
            > Value <> vbNullString
            > End Function
            >
            > I'm not as concerned by the rejection of entries that include one or more
            > thousand's separators, but we can handle this if we don't insist on the
            > thousand's separator being located in the correct positions (in other
            > words,
            > we'll allow the user to include them for their own purposes... we'll just
            > tolerate their presence).
            >
            > Function IsNumber(ByVal Value As String) As Boolean
            > Dim DP As String
            > Dim TS As String
            > ' Get local setting for decimal point
            > DP = Format$(0, ".")
            > ' Get local setting for thousand's separator
            > ' and eliminate them. Remove the next two lines
            > ' if you don't want your users being able to
            > ' type in the thousands separator at all.
            > TS = Mid$(Format$(10 00, "#,###"), 2, 1)
            > Value = Replace$(Value, TS, "")
            > ' Leave the next statement out if you don't
            > ' want to provide for plus/minus signs
            > If Value Like "[+-]*" Then Value = Mid$(Value, 2)
            > IsNumber = Not Value Like "*[!0-9" & DP & "]*" And _
            > Not Value Like "*" & DP & "*" & DP & "*" And _
            > Len(Value) > 0 And Value <> DP And _
            > Value <> vbNullString
            > End Function
            >[/color]

            interesting, you have made a comprehensive study of the flawed isNumeric()
            function
            I don't understand this aspect of your code : Like "*[!0-9]*" can't find it
            in my VB manual.
            what's going on there?

            cw





            Comment

            • Rick Rothstein [MVP - Visual Basic]

              #21
              Re: visual basic input validation integer

              > interesting, you have made a comprehensive study[color=blue]
              > of the flawed isNumeric() function[/color]

              I had to... I wouldn't have been able to sell the article to the magazine if
              I didn't.<g>
              [color=blue]
              > I don't understand this aspect of your code :
              > Like "*[!0-9]*" can't find it in my VB manual.
              > what's going on there?[/color]

              Like is an operator used for comparing a text string to a string pattern
              (similar to how regular expressions work, but on a much more limited scale).
              You should be able to look up the Like Operator in your VB help files. You
              can also view the help file for it online at this link

              Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


              Anyway, everything inside of the brackets stands for a single character. The
              0-9 part indicates the digit characters (ranging for "0" to "9") and the
              exclamation sign at the beginning says to consider all characters except for
              what follows it. So that means that any character that is not a digit will
              match the this pattern. The two asterisks on either side of the brackets
              match zero or more characters, no matter what those characters are. So, the
              whole expression to the right of the Like operator matches any non-digit, no
              matter where it occurs in the text string being examined. The left side of
              the Like operator expression (which you left out of your question) is very
              important to the construction of functionality of this entire expression.
              Here is the part of the original expression that you asked about

              Not Value Like "*[!0-9]*"

              where Value is the text string being examined. Remember the expression on
              the right of the Like operator matches a non-digit anywhere in the string
              contained in the Value variable... the Not operator in front of the
              expression negates that meaning the entire expression is True when no
              non-digit is found in the text string. That condition, no non-digit, means
              the expression is composed only of digits. You must use this double-negative
              approach to test for this; you cannot not do it directly in any other way.

              Rick


              Comment

              • Steve Gerrard

                #22
                Re: visual basic input validation integer


                "code_wrong " <tac@tac.co.u k> wrote in message
                news:44074b40$1 _2@mk-nntp-2.news.uk.tisca li.com...[color=blue]
                >
                > interesting, you have made a comprehensive study of the flawed isNumeric()
                > function[/color]

                Since Rick posted his IsNumeric post, I will toss in mine as well :)

                IsNumeric has one particular purpose, which it does well, so it is not flawed.
                Its function is to determine whether or not a particular expression can be
                converted to a number without causing an error.

                As Rick points out, the test

                IsNumeric("($1, 23,,3.4,,,5,,E6 7$)")

                returns True, which is correct, because the conversion

                X = CDbl("($1,23,,3 .4,,,5,,E67$)")

                will assign X the value

                -1.23345E+70

                rather than raising an error.

                In case you are curious, the conversion will ignore the commas and $, since they
                are allowed in numeric expressions, and it will treat the enclosing parentheses
                as an accountant's version of a minus sign.
                That gives it -1233.45 E67, which the VB immediate window then displays in
                "proper" scientific notation.

                IsNumeric is not meant to be, and quite plainly is not, a strict input parsing
                function, but is rather a programming tool with which to avoid "Type Mismatch"
                errors during conversions steps.


                Comment

                • Lord Duran

                  #23
                  Re: visual basic input validation integer

                  Duane Arnold wrote:[color=blue]
                  > code_wrong wrote:
                  >[color=green]
                  >> "code_wrong " <tac@tac.co.u k> wrote in message
                  >> news:4404ac4c$1 _3@mk-nntp-2.news.uk.tisca li.com...
                  >>[color=darkred]
                  >>> Visual Basic (not dot net)
                  >>> what is the best way to check the User has entered an integer into an
                  >>> InputBox?
                  >>>
                  >>> isNumeric() checks for a numeric value .. but does not notify of
                  >>> numbers with decimal places
                  >>> inputBox returns a string so I could check for decimal point??? this
                  >>> seems like overkill
                  >>>
                  >>> The value returned can be asigned into an Integer type and then a
                  >>> Single type ... the two can be compared .. but still this does not
                  >>> complain about numbers with decimal places if the fractional part is
                  >>> zero
                  >>>
                  >>> what is the simple solution?[/color]
                  >>
                  >>
                  >>
                  >> Interesting discussion , thanks for the replies.
                  >> I have decided to provide students with a pre-defined function of my
                  >> own design
                  >> please review and improve if you can
                  >> the function:
                  >>
                  >> Function isInteger(strVa l As String) As Boolean
                  >>
                  >> 'if not numeric or decimal point found
                  >> If Not IsNumeric(strVa l) Or InStr(strVal, ".") Then
                  >> isInteger = False
                  >> Else
                  >> isInteger = True
                  >> End If
                  >>
                  >> End Function
                  >>
                  >>
                  >>[/color]
                  >
                  > If you have tested it and it works -- it works.
                  >
                  > Does it need to be complicated for some reason?
                  >
                  > Duane :)[/color]

                  It seems to me that a simple cast and cast back can be used for validation:

                  Function MyIsNumeric(ByV al cand as String) as Boolean
                  If cand = CStr(CLng(cand) ) Then
                  MyIsNumeric = True
                  Else
                  MyIsNumeric = False
                  End Function

                  But take that with a grain of salt, I haven't actually tested it.

                  Comment

                  • J French

                    #24
                    Re: visual basic input validation integer

                    On Tue, 14 Mar 2006 11:20:21 +0200, Lord Duran <lord.duran@gma il.com>
                    wrote:


                    <snip>
                    [color=blue]
                    >It seems to me that a simple cast and cast back can be used for validation:
                    >
                    >Function MyIsNumeric(ByV al cand as String) as Boolean
                    > If cand = CStr(CLng(cand) ) Then
                    > MyIsNumeric = True
                    > Else
                    > MyIsNumeric = False
                    >End Function
                    >
                    >But take that with a grain of salt, I haven't actually tested it.[/color]

                    It will blow big time - if the String contains 'FRED'

                    Incidentally you are mis-using the word 'Cast'
                    - CStr and CLng are are Functions that 'Convert'
                    ( the 'C' stands for Convert - 'Cast' is something entirely different
                    better not gone into now )

                    With Error Handling then what you suggest is half way there

                    IMO the best method is to handle all checking extremely rigorously




                    Comment

                    • Dean Earley

                      #25
                      Re: visual basic input validation integer

                      > It seems to me that a simple cast and cast back can be used for validation:[color=blue]
                      >
                      > Function MyIsNumeric(ByV al cand as String) as Boolean
                      > If cand = CStr(CLng(cand) ) Then
                      > MyIsNumeric = True
                      > Else
                      > MyIsNumeric = False
                      > End Function
                      >
                      > But take that with a grain of salt, I haven't actually tested it.[/color]

                      You may want to use Val() rather than CLng() as the latter will error
                      when its not a number.

                      --
                      Dean Earley (dean.earley@ic ode.co.uk)
                      i-Catcher Development Team

                      iCode Systems

                      Comment

                      • Rick Rothstein [MVP - Visual Basic]

                        #26
                        Re: visual basic input validation integer

                        > It seems to me that a simple cast and cast back can be used for
                        validation:[color=blue]
                        >
                        > Function MyIsNumeric(ByV al cand as String) as Boolean
                        > If cand = CStr(CLng(cand) ) Then
                        > MyIsNumeric = True
                        > Else
                        > MyIsNumeric = False
                        > End Function
                        >
                        > But take that with a grain of salt, I haven't actually tested it.[/color]

                        The problem with that approach (whether you use CLng or Val (as Dean
                        suggested), is it will show as valid a number from that is normally useless
                        in an input validation scenario (which is what this thread is about). The
                        reason is because when a programmer uses such routines, they are NOT really
                        interested in whether the entry is a number; rather the programmer usually
                        wants the entry to be all digits (such as in a phone number). As an example,
                        let's say the programmer wanted the user to input a 4-digit number for
                        whatever reason and, to eliminate the need to check the length of the entry,
                        he/she sets the MaxLength property of the TextBox being used to accept the
                        user's entry to 4. Is everything okay then? Nope! Your routine will fail the
                        programmer for an entry like 12e3 (notice the embedded "e"). Your routine
                        would return True because 12e3 is a valid number... it is 12000 when
                        expanded... but note that is a 5-digit number, not 4-digit number as
                        required, and that would probably screw up the program when it tried to use
                        it.

                        Rick


                        Comment

                        • Duane Arnold

                          #27
                          Re: visual basic input validation integer

                          Rick Rothstein [MVP - Visual Basic] wrote:[color=blue][color=green]
                          >>It seems to me that a simple cast and cast back can be used for[/color]
                          >
                          > validation:
                          >[color=green]
                          >>Function MyIsNumeric(ByV al cand as String) as Boolean
                          >> If cand = CStr(CLng(cand) ) Then
                          >> MyIsNumeric = True
                          >> Else
                          >> MyIsNumeric = False
                          >>End Function
                          >>
                          >>But take that with a grain of salt, I haven't actually tested it.[/color]
                          >
                          >
                          > The problem with that approach (whether you use CLng or Val (as Dean
                          > suggested), is it will show as valid a number from that is normally useless
                          > in an input validation scenario (which is what this thread is about). The
                          > reason is because when a programmer uses such routines, they are NOT really
                          > interested in whether the entry is a number; rather the programmer usually
                          > wants the entry to be all digits (such as in a phone number). As an example,
                          > let's say the programmer wanted the user to input a 4-digit number for
                          > whatever reason and, to eliminate the need to check the length of the entry,
                          > he/she sets the MaxLength property of the TextBox being used to accept the
                          > user's entry to 4. Is everything okay then? Nope! Your routine will fail the
                          > programmer for an entry like 12e3 (notice the embedded "e"). Your routine
                          > would return True because 12e3 is a valid number... it is 12000 when
                          > expanded... but note that is a 5-digit number, not 4-digit number as
                          > required, and that would probably screw up the program when it tried to use
                          > it.
                          >
                          > Rick
                          >
                          >[/color]
                          It's poor programming if that were to happen. That's why one would have
                          further validation of the inputed data expecting it to be saved and
                          checking for the validity of data in business rules somewhere else no
                          complication in UI, except for a simple check for numerics for a given
                          field.

                          Duane :)

                          Comment

                          • Lord Duran

                            #28
                            That example is not good

                            Rick Rothstein [MVP - Visual Basic] wrote:[color=blue][color=green]
                            >>It seems to me that a simple cast and cast back can be used for[/color]
                            >
                            > validation:
                            >[color=green]
                            >>Function MyIsNumeric(ByV al cand as String) as Boolean
                            >> If cand = CStr(CLng(cand) ) Then
                            >> MyIsNumeric = True
                            >> Else
                            >> MyIsNumeric = False
                            >>End Function
                            >>
                            >>But take that with a grain of salt, I haven't actually tested it.[/color]
                            >
                            >
                            > The problem with that approach (whether you use CLng or Val (as Dean
                            > suggested), is it will show as valid a number from that is normally useless
                            > in an input validation scenario (which is what this thread is about). The
                            > reason is because when a programmer uses such routines, they are NOT really
                            > interested in whether the entry is a number; rather the programmer usually
                            > wants the entry to be all digits (such as in a phone number). As an example,
                            > let's say the programmer wanted the user to input a 4-digit number for
                            > whatever reason and, to eliminate the need to check the length of the entry,
                            > he/she sets the MaxLength property of the TextBox being used to accept the
                            > user's entry to 4. Is everything okay then? Nope! Your routine will fail the
                            > programmer for an entry like 12e3 (notice the embedded "e"). Your routine
                            > would return True because 12e3 is a valid number... it is 12000 when
                            > expanded... but note that is a 5-digit number, not 4-digit number as
                            > required, and that would probably screw up the program when it tried to use
                            > it.
                            >
                            > Rick
                            >
                            >[/color]

                            I don't know how robust that things is, but your example would not work
                            here - because CStr(Val("12e3" )) = "12000" which is not equal to "12e3"
                            when comparing strings.

                            Comment

                            Working...