title: How to multiply doubles in Visual Basic 6?
body: <p>We are playing around with EAN13-barcodes and checking if the number format is correct. And when it is we want to get the number out in the proper format. We get the compile error: <strong>"Expected: end of statement"</strong> when we try this.
  The error occurs in the "<em>weight = first...</em>" calculations in the code.</p>
  
  <p>Any idea what might be wrong? Tried to google the error and we didn't find anything applicable to our situation. </p>
  
  <pre><code>Dim first As Double
  Dim second As Double
  Dim third As Double
  Dim fourth As Double
  
  If Left(data, 5) = 3 Or Left(data, 5) = 4 Or Left(data, 5) = 5 Then
  ' Checking if it's a weight and then converting the string to double
          first = CDbl(Val(Left(data, 12)))
          second = CDbl(Val(Left(data, 13)))
          third = CDbl(Val(Left(data, 14)))
          fourth = CDbl(Val(Left(data, 15)))
  
          If Left(data, 5) = 3 Then
          ' 1,234 kg
              weight = first * 1 + second * 0,1 + third * 0,01 + fourth * 0,001
          ElseIf Left(data, 5) = 4 Then
          ' 12,34 kg
              weight = first * 10 + second * 1 + third * 0,1 + fourth * 0,01
          ElseIf Left(data, 5) = 5 Then
          ' 123,4 kg
              weight = first * 100 + second * 10 + third * 1 + fourth * 0,1
          End If
      End If
  
  End If
  </code></pre>