Skip to content

Commit

Permalink
Merge pull request #321 from kkr-Christopher/master
Browse files Browse the repository at this point in the history
Fix '=' in Google Sheets
  • Loading branch information
mk-j authored May 31, 2023
2 parents f72f0d2 + aab9f0d commit d521081
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 @@ -370,7 +370,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 d521081

Please sign in to comment.