From 9cacc2fda7fbf87655adb987c1d31250faadf768 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Mon, 6 Dec 2010 12:42:16 +0000 Subject: [PATCH] Feature: (MBaker) Fix to toFormattedString() method in PHPExcel_Style_NumberFormat to handle fractions with a # code for the integer part git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@64874 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Style/NumberFormat.php | 2 +- changelog.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Classes/PHPExcel/Style/NumberFormat.php b/Classes/PHPExcel/Style/NumberFormat.php index 18feee2..f4e957d 100644 --- a/Classes/PHPExcel/Style/NumberFormat.php +++ b/Classes/PHPExcel/Style/NumberFormat.php @@ -649,7 +649,7 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable $adjustedDecimalPart = $decimalPart/$GCD; $adjustedDecimalDivisor = $decimalDivisor/$GCD; - if ((strpos($format,'0') !== false) || (substr($format,0,3) == '? ?')) { + if ((strpos($format,'0') !== false) || (strpos($format,'#') !== false) || (substr($format,0,3) == '? ?')) { if ($integerPart == 0) { $integerPart = ''; } $value = "$sign$integerPart $adjustedDecimalPart/$adjustedDecimalDivisor"; } else { diff --git a/changelog.txt b/changelog.txt index c9db10d..3ab4366 100644 --- a/changelog.txt +++ b/changelog.txt @@ -35,6 +35,7 @@ Fixed in SVN: - Feature: (MBaker) Added Contiguous flag for the CSV Reader, when working with Read Filters - Feature: (MBaker) Added getFormattedValue() method for cell object - Feature: (MBaker) Added strictNullComparison argument to the worksheet fromArray() method +- Feature: (MBaker) Fix to toFormattedString() method in PHPExcel_Style_NumberFormat to handle fractions with a # code for the integer part - Bugfix: (MB) Work item 14143 - NA() doesn't propagate in matrix calc - quick fix in JAMA/Matrix.php - Bugfix: (Progi1984) Work item 7895 - Excel5 : Formula : String constant containing double quotation mark - Bugfix: (Progi1984) Work item 7895 - Excel5 : Formula : Percent