title: JSTL fmt:formatNumber
body: <p>How do I format a variable with &lt;fmt:formatNumber&gt; ? I'm learning JSTL and converting from old Struts tags. This doesn't work. It can't read the distance variable!</p>
  
  <pre><code>    &lt;%double distance=geo.getDistance(geo.getLatitude(), geo.getLongitude(), lat, lng);%&gt;
      &lt;c:set var="distanceEL" value="${distance}"/&gt;
      ${distance}, 
      &lt;fmt:formatNumber pattern="0.0" value="${distance}"/&gt;, 
      &lt;fmt:formatNumber pattern="0.0" value="${distanceEL}"/&gt;, 
      &lt;fmt:formatNumber pattern="0.0" value="1234.567"/&gt;,
      &lt;%= new java.text.DecimalFormat("0.0").format(distance) %&gt;
  </code></pre>
  
  <p>It displays as </p>
  
  <pre><code>, , , 1234.6, 19.3
  </code></pre>
  
  <p>I'm using JSTL 1.2. So far I'm not impressed.</p>