diff --git a/README.md b/README.md index 0e0de79..d00dacb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# SimpleXLSXGen class 0.9.16 (Official) +# SimpleXLSXGen class 0.9.17 (Official) [](https://www.patreon.com/shuchkin) [](https://github.com/shuchkin/simplexlsxgen/blob/master/license.md) [](https://github.com/shuchkin/simplexlsxgen/stargazers) [](https://github.com/shuchkin/simplexlsxgen/network) [](https://github.com/shuchkin/simplexlsxgen/issues) Export data to Excel XLSX file. PHP XLSX generator. No external tools and libraries.
@@ -62,7 +62,8 @@ SimpleXLSXGen::fromArray( $data )->saveAs('debug.xlsx'); ## History -v0.9.16 (2020-07-29) Fixed time detection in HH:MM:SS format +v0.9.17 (2020-08-21) Fixed real numbers in 123.45 format detection, fast shared strings index (thx fredriksundin)
+v0.9.16 (2020-07-29) Fixed time detection in HH:MM:SS format
v0.9.15 (2020-07-14) escape of shared strings for special chars in cells [#1](https://github.com/shuchkin/simplexlsxgen/issues/1)
v0.9.14 (2020-05-31) fixed num2name A-Z,AA-AZ column names, thx Ertan Yusufoglu
v0.9.13 (2020-05-21) if string more 160 chars, save as inlineStr
diff --git a/src/SimpleXLSXGen.php b/src/SimpleXLSXGen.php index fc2c42b..337511b 100644 --- a/src/SimpleXLSXGen.php +++ b/src/SimpleXLSXGen.php @@ -190,12 +190,12 @@ class SimpleXLSXGen { if ( preg_match( '/^[-+]?\d{1,18}$/', $v ) ) { $cv = ltrim($v,'+'); - } elseif ( preg_match('/^[-+]?\d+\.?\d*$/', $v ) ) { + } elseif ( preg_match('/^[-+]?\d+\.\d+$/', $v ) ) { $cv = ltrim($v,'+'); } elseif ( preg_match('/^([-+]?\d+)%$/', $v, $m) ) { $cv = round( $m[1] / 100, 2); $cs = 1; // [9] 0% - } elseif ( preg_match('/^([-+]\d+\.\d*)%$/', $v, $m) ) { + } elseif ( preg_match('/^([-+]\d+\.\d+)%$/', $v, $m) ) { $cv = round( $m[1] / 100, 4 ); $cs = 2; // [10] 0.00% } elseif ( preg_match('/^(\d\d\d\d)-(\d\d)-(\d\d)$/', $v, $m ) ){ @@ -214,7 +214,7 @@ class SimpleXLSXGen { $ct = 's'; // shared string $v = str_replace(['&','<','>'],['&','<','>'], $v); $cv = false; - if ( isset($SI_KEYS[$v]) && $SI[$SI_KEYS[$v]] === $v ) { + if ( isset($SI_KEYS[$v]) ) { $cv = $SI_KEYS[$v]; }