From 193a766ab33ca96a3dc8a85004778715ddcaeccc Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Sun, 8 Apr 2012 14:52:27 +0000 Subject: [PATCH] Fix to UOM Conversion where input UoM is the same as output UoM git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@88979 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Calculation/Engineering.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classes/PHPExcel/Calculation/Engineering.php b/Classes/PHPExcel/Calculation/Engineering.php index 9e26004c..efae2e24 100644 --- a/Classes/PHPExcel/Calculation/Engineering.php +++ b/Classes/PHPExcel/Calculation/Engineering.php @@ -2471,7 +2471,9 @@ class PHPExcel_Calculation_Engineering { } if (($fromUOM == $toUOM) && ($fromMultiplier == $toMultiplier)) { - return $value; + // We've already factored $fromMultiplier into the value, so we need + // to reverse it again + return $value / $fromMultiplier; } elseif ($unitGroup1 == 'Temperature') { if (($fromUOM == 'F') || ($fromUOM == 'fah')) { if (($toUOM == 'F') || ($toUOM == 'fah')) {