title: How to multiply a decimal number in PHP and get a result with decimal places
body: <p>I have the following code which multiplies a number (number is stored in a database) and I then download the result to a CSV file. The resulting number is given as a whole number rather than including a decimal place.</p>
  
  <p><strong>Current Code</strong></p>
  
  <pre><code>&lt;? return ((float) $amount*1) ?&gt;
  </code></pre>
  
  <p><strong>Current Result:</strong> 2 x 2.13 = 4</p>
  
  <p><strong>Desired Result:</strong> 2 x 2.13 = 4.26</p>
  
  <p><em>In this example $amount = 2.13</em></p>
  
  <p>Can anyone please suggest an edit to get this working?</p>