title: Classic ASP, IIS 8.5, CINT CLNG not working
body: <p>Reinstalled my dev machine with win 8.1
  Enabled ASP, installed my legacy websites that I have to maintain, installed sites as an application in IIS, enabled parent paths, send errors to browser on, full detail set on in error pages. All is working well, except when I work with numbers</p>
  
  <p>I'm working in a system that captures financial data inputted by users, so often a number will be: 100.0 or 
  100.000 or 
  100 or 
  100,00</p>
  
  <p>so I have a function that (I've used on loads of websites in the past) that will standardise the irregularities into a constant format, such as 100.00 (ie: proper decimal, always using a dot, etc)</p>
  
  <p>This line now fails on win 8.1 IIS 8.5: <strong><em>If Cdbl(myString) = Cdbl(0) Then</em></strong></p>
  
  <pre><code>Function ProperDecimal(s_String)
      Dim CharPlace, DotChar, iLoop, strCurrentChar, myString
      myString = TRIM(s_String)
      If ISNULL(myString) OR myString = "" Then myString = 0
      myString = REPLACE(myString,",",".")
  
      'Find where the comma or dot is, ie: 100.00 is in position 3 (from the right)
      CharPlace = 1
      DotChar = 0
      For iLoop = Len(Replace(myString, " ", "")) to 1 Step -1
          strCurrentChar = mid(Replace(myString, " ", ""), iLoop, 1)
          If strCurrentChar = "." OR strCurrentChar = "," Then
              DotChar = CharPlace
              Exit For
          End If
      CharPlace = CharPlace + 1
      Next
  
      'If string is zero, leave it at zero, we dont need 0.00
      If Cdbl(myString) = Cdbl(0) Then
          'ignore it, no decimal places needed
          ProperDecimal = myString
      Else
          'Where is the DOT
          Select Case DotChar
              Case 0 'eg: 100 will be converted to 100.00
                  ProperDecimal = (myString &amp; ".00")
              Case 1 'eg: 100. will be converted to 100.00
                  ProperDecimal = (myString &amp; "00")
              Case 2 'eg: 100.0 will be converted to 100.00
                  ProperDecimal = (myString &amp; "0")
              Case 3 'eg: 100.00 will remain
                  ProperDecimal = (myString)
              Case Else '(4, 5, 6, 7, 8, etc) 'eg: 100.001
                  ProperDecimal = ProperDecimal(Round(myString,2))
          End Select
      End If
  End Function
  
  Call ProperDecimal("112.05")
  </code></pre>
  
  <p>This lead me to try other methods other than CDbl</p>
  
  <pre><code>Response.write(isNumeric(s_String)) 'works, returns false because this is a string
  Response.write(CINT(myString))
  Response.write(CLNG(myString))
  Response.write(CDBL(myString))
  </code></pre>
  
  <p>Returns this:</p>
  
  <p>Microsoft VBScript runtime error '800a000d'
  Type mismatch: 'CINT' </p>
  
  <p>Microsoft VBScript runtime error '800a000d'
  Type mismatch: 'CLNG' </p>
  
  <p>Microsoft VBScript runtime error '800a000d'
  Type mismatch: 'CDBL' </p>
  
  <p>Microsoft VBScript runtime error '800a000d'
  Type mismatch: 'CINT' </p>
  
  <p>If I then change the If statement to convert the 0 to a string, it works: </p>
  
  <pre><code>If myString = CSTR(0) Then
  </code></pre>
  
  <p>But I really dont want to be comparing strings to strings especially with numbers</p>
  
  <p>This is now the second project this is happening on. The previous project I had to change the decimal comma to a fullstop (112,05 had to be 112.05) so I thought it had something to do with regional settings and the comma being listed as decimal character. But am getting different results now, its driving me up the wall.. plz assist if you can. Ta</p>