From 9588bec9a37ace8dcb960a6f559f9db207122e48 Mon Sep 17 00:00:00 2001 From: Ian Douglas Date: Thu, 18 Feb 2016 08:33:55 -0700 Subject: [PATCH] Increase precision of USPS shipping weight ounces USPS allows for decimals in ounce weight (specifically, they allow 10 digits). Remove the whole-number rounding from the ounce calculation. --- app/code/Magento/Usps/Model/Carrier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Usps/Model/Carrier.php b/app/code/Magento/Usps/Model/Carrier.php index 1fdc35eab1393..b6755020c46c3 100644 --- a/app/code/Magento/Usps/Model/Carrier.php +++ b/app/code/Magento/Usps/Model/Carrier.php @@ -317,7 +317,7 @@ public function setRequest(\Magento\Quote\Model\Quote\Address\RateRequest $reque $weight = $this->getTotalNumOfBoxes($request->getPackageWeight()); $r->setWeightPounds(floor($weight)); - $r->setWeightOunces(round(($weight - floor($weight)) * self::OUNCES_POUND, 1)); + $r->setWeightOunces(round(($weight - floor($weight)) * self::OUNCES_POUND, 10)); if ($request->getFreeMethodWeight() != $request->getPackageWeight()) { $r->setFreeMethodWeight($request->getFreeMethodWeight()); }