示例#1
0
 /**
  * Parses quantity depending on isQtyDecimal flag
  *
  * @param float $quantity
  * @param Enterprise_Rma_Model_Item $item
  * @return int|float
  */
 public function parseQuantity($quantity, $item)
 {
     if (is_null($quantity)) {
         $quantity = $item->getOrigData('qty_requested');
     }
     if ($item->getIsQtyDecimal()) {
         return sprintf("%01.4f", $quantity);
     } else {
         return intval($quantity);
     }
 }