title: MySQL Cast to Float or What Decimal value
body: <p>I develop software for an insurance environment, so decimal values are very important.
  We are converting from MSSQL to MYSQL. The query my question relates to is:</p>
  
  <pre><code>SELECT CAST(
      CAST(
        (initialpremium - totalpremium) / 2 * 
        CAST(premiummultiplier AS INT) 
      AS FLOAT) 
  FROM policy 
  /* rest of the query... */
  </code></pre>
  
  <p>This code works in MSSQL but not in MYSQL.
  <a href="http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html" rel="nofollow">This is valid cast types for mysql</a>. </p>
  
  <p>The question that I have therefor is, is what is the correct decimal length for float.
  <a href="http://technet.microsoft.com/en-us/library/ms173773.aspx" rel="nofollow">This link does not help. But describes converting from float to real in MSSQL</a> and I have searched for <a href="https://www.google.co.za/search?q=float%20datasize%20mssql&amp;oq=float%20datasize%20mssql&amp;aqs=chrome..69i57.4115j0j7&amp;sourceid=chrome&amp;espv=2&amp;es_sm=93&amp;ie=UTF-8" rel="nofollow">float datasize mssql</a> on the internet.</p>