I am exporting an HTML table to excel. But when I want to export a number with decimals (float / double) that contain a point
20.02 < "."
The excel thinks that it is a string, no matter what type it is (because I've done a gettype and it shows me double), just because it contains the point it reads it as a string.
Im using next code:
$filename = "filename.xls";
header('Content-Type: content=text/html; charset=ISO-8859-1');
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=$filename");
Then table: (this is a example)
<table>
<tr>
<th>Float</th>
</tr>
<tr>
<td> <?php echo utf8_decode($float) ?></td>
</tr>
</table>
All the code works, I export a perfect excel, just as I want, the only problem I find is the conversion of the float that HTML reads as a STRING when reading a " . "