title: What is up with this in ColdFusion's DecimalFormat() function? How do I get the correct result?
body: <pre><code>&lt;cfset number1 = 20.5/80 * 100 /&gt;
  &lt;cfset number2 = 18.125 /&gt;
  &lt;cfset number3 = 6.875 /&gt;
  
  &lt;cfoutput&gt;
  DecimalFormat(#number1#): #DecimalFormat(number1)#&lt;br /&gt;
  DecimalFormat(#number2#): #DecimalFormat(number2)#&lt;br /&gt;
  DecimalFormat(#number3#): #DecimalFormat(number3)#
  &lt;/cfoutput&gt;
  </code></pre>
  
  <p><strong>OUTPUTS:</strong></p>
  
  <p>DecimalFormat(25.625): 25.62</p>
  
  <p>DecimalFormat(18.125): 18.13</p>
  
  <p>DecimalFormat(6.875): 6.88</p>
  
  <p><strong>RATHER THAN OUTPUTING:</strong></p>
  
  <p>DecimalFormat(25.625): 25.63</p>
  
  <p>DecimalFormat(18.125): 18.13</p>
  
  <p>DecimalFormat(6.875): 6.88</p>
  
  <p>It seems that a variable that is the result of a mathematical calculation makes DecimalFormat() behave differently. Any quick fix, without digging into java?</p>