#1153: preserve leading zeroes (in "numeric" fields) in the Excel export.

SVN:trunk[3879]
This commit is contained in:
Denis Flaven
2016-01-26 09:50:35 +00:00
parent 9da19de860
commit 8a99b09e83

View File

@@ -154,7 +154,7 @@ Class XLSXWriter
$cell = self::xlsCell($row_number, $column_number);
$s = isset($styles[$cell_format]) ? $styles[$cell_format] : '0';
if (is_numeric($value)) {
if (is_int($value) || is_float($value)) {
fwrite($fd,'<c r="'.$cell.'" s="'.$s.'" t="n"><v>'.($value*1).'</v></c>');//int,float, etc
} else if ($cell_format=='date') {
fwrite($fd,'<c r="'.$cell.'" s="'.$s.'" t="n"><v>'.intval(self::convert_date_time($value)).'</v></c>');