Skip to content

Commit

Permalink
Fix '=' in Google Sheets
Browse files Browse the repository at this point in the history
  • Loading branch information
kkr-Christopher authored Mar 8, 2022
1 parent 4da41e4 commit aab9f0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xlsxwriter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ protected function writeCell(XLSXWriter_BuffererWriter &$file, $row_number, $col
if (!is_scalar($value) || $value==='') { //objects, array, empty
$file->write('<c r="'.$cell_name.'" s="'.$cell_style_idx.'"/>');
} elseif (is_string($value) && $value[0]=='='){
$file->write('<c r="'.$cell_name.'" s="'.$cell_style_idx.'" t="s"><f>'.self::xmlspecialchars($value).'</f></c>');
$file->write('<c r="'.$cell_name.'" s="'.$cell_style_idx.'" t="s"><f>'.self::xmlspecialchars(ltrim($value, '=')).'</f></c>');
} elseif ($num_format_type=='n_date') {
$file->write('<c r="'.$cell_name.'" s="'.$cell_style_idx.'" t="n"><v>'.intval(self::convert_date_time($value)).'</v></c>');
} elseif ($num_format_type=='n_datetime') {
Expand Down

0 comments on commit aab9f0d

Please sign in to comment.