title: How to convert String to double in JSP
body: <p>I'm extracting some results in the table in JPS like this :</p>
  
  <pre><code>&lt;tr&gt;
            &lt;td&gt;${item[0]}&lt;/td&gt;
            &lt;td&gt;${item[5]}&lt;/td&gt;
            &lt;td&gt;${item[1]}&lt;/td&gt;
            &lt;td&gt;${item[2]}&lt;/td&gt;
            &lt;td&gt;${item[5]}&lt;/td&gt;
            &lt;td&gt;${item[6]}&lt;/td&gt;
          &lt;/tr&gt;
  </code></pre>
  
  <p>Now I'd like to add one more column which will be percentage <code>${item[2]}</code> divided by <code>${item[1]}</code> . But these are strings how do convert the result to double?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>In both answers so far I get compile error resulting in :</p>
  
  <pre><code>org.apache.jasper.JasperException: Unable to compile class for JSP: 
  
  An error occurred at line: 30 in the jsp file: /WEB-INF/views/home.jsp
  Syntax error, insert ")" to complete MethodInvocation
  27:           &lt;td&gt;${item[5]}&lt;/td&gt;
  28:           &lt;td&gt;${item[1]}&lt;/td&gt;
  29:           &lt;td&gt;${item[2]}&lt;/td&gt;
  30:           &lt;td&gt;&lt;%= Double.parseDouble(${item[2]})/Double.parseDouble(${item[1]}) %&gt; &lt;/td&gt;
  31:           &lt;td&gt;${item[5]}&lt;/td&gt;
  32:           &lt;td&gt;${item[6]}&lt;/td&gt;
  33:         &lt;/tr&gt;
  </code></pre>
  
  <p><strong>More code :</strong></p>
  
  <pre><code>&lt;table width="100%"&gt;
        &lt;c:forEach var="item" items="${myList}"&gt;
          &lt;tr&gt;
            &lt;td&gt;${item[0]}&lt;/td&gt;
            &lt;td&gt;${item[5]}&lt;/td&gt;
            &lt;td&gt;${item[1]}&lt;/td&gt;
            &lt;td&gt;${item[2]}&lt;/td&gt;
            &lt;td&gt;&lt;%= Double.valueOf(item[2]) / Double.valueOf(item[1]) %&gt;&lt;/td&gt;
            &lt;td&gt;${item[5]}&lt;/td&gt;
            &lt;td&gt;${item[6]}&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/c:forEach&gt;
      &lt;/table&gt;
  </code></pre>