mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-29 08:46:03 +03:00
Fix to complex number format signing when mask has a decimal
This commit is contained in:
parent
d778b41524
commit
fb18b7b598
@ -505,8 +505,8 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
|
|||||||
$numbers = explode('.', $number . '.0');
|
$numbers = explode('.', $number . '.0');
|
||||||
$masks = explode('.', $mask . '.0');
|
$masks = explode('.', $mask . '.0');
|
||||||
$result1 = self::_complexNumberFormatMask($numbers[0], $masks[0], 1);
|
$result1 = self::_complexNumberFormatMask($numbers[0], $masks[0], 1);
|
||||||
$result2 = strrev(self::_complexNumberFormatMask(strrev($numbers[1]), strrev($masks[1])), 1);
|
$result2 = strrev(self::_complexNumberFormatMask(strrev($numbers[1]), strrev($masks[1]), 1));
|
||||||
return $result1 . '.' . $result2;
|
return (($sign) ? '-' : '') . $result1 . '.' . $result2;
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = preg_match_all('/0+/', $mask, $result, PREG_OFFSET_CAPTURE);
|
$r = preg_match_all('/0+/', $mask, $result, PREG_OFFSET_CAPTURE);
|
||||||
|
@ -33,3 +33,5 @@
|
|||||||
123456789, '0 (+00) 0000 00 00 00', "0 (+00) 0123 45 67 89"
|
123456789, '0 (+00) 0000 00 00 00', "0 (+00) 0123 45 67 89"
|
||||||
123456789, '0000:00:00', "12345:67:89"
|
123456789, '0000:00:00', "12345:67:89"
|
||||||
-123456789, '0000:00:00', "-12345:67:89"
|
-123456789, '0000:00:00', "-12345:67:89"
|
||||||
|
1234567.89, '0000:00.00', "12345:67.89"
|
||||||
|
-1234567.89,'0000:00.00', "-12345:67.89"
|
||||||
|
Loading…
Reference in New Issue
Block a user