1
0
mirror of https://github.com/shuchkin/simplexlsxgen.git synced 2023-08-10 21:12:59 +03:00

Merge pull request #34 from marcrobledo/marcrobledo-fix-percentage

fix percentage with decimals
This commit is contained in:
Sergey Shuchkin 2021-05-14 16:37:33 +06:00 committed by GitHub
commit 41c6e7ca51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -476,7 +476,7 @@ class SimpleXLSXGen {
} elseif ( preg_match( '/^([-+]?\d+)%$/', $v, $m ) ) { } elseif ( preg_match( '/^([-+]?\d+)%$/', $v, $m ) ) {
$cv = round( $m[1] / 100, 2 ); $cv = round( $m[1] / 100, 2 );
$N = self::N_PERCENT_INT; // [9] 0% $N = self::N_PERCENT_INT; // [9] 0%
} elseif ( preg_match( '/^([-+]\d+\.\d+)%$/', $v, $m ) ) { } elseif ( preg_match( '/^([-+]?\d+\.\d+)%$/', $v, $m ) ) {
$cv = round( $m[1] / 100, 4 ); $cv = round( $m[1] / 100, 4 );
$N = self::N_PRECENT_DEC; // [10] 0.00% $N = self::N_PRECENT_DEC; // [10] 0.00%
} elseif ( preg_match( '/^(\d\d\d\d)-(\d\d)-(\d\d)$/', $v, $m ) ) { } elseif ( preg_match( '/^(\d\d\d\d)-(\d\d)-(\d\d)$/', $v, $m ) ) {