/**
  * @param BaseQuoteProductItem $item
  * @param string $default
  * @return string
  */
 protected function formatProductUnit(BaseQuoteProductItem $item, $default = '')
 {
     if (!$item->getProductUnit()) {
         return sprintf('%s %s', $item->getQuantity(), $item->getProductUnitCode());
     } elseif ($item->getQuantity()) {
         return $this->productUnitValueFormatter->format($item->getQuantity(), $item->getProductUnit());
     }
     return $default;
 }
 /**
  * Test Format
  */
 public function testFormat()
 {
     $this->translator->expects($this->once())->method('transChoice')->with('orob2b.product_unit.kg.value.full', 42);
     $this->formatter->format(42, (new ProductUnit())->setCode('kg'));
 }
 /**
  * @param float|integer $value
  * @param ProductUnit $unit
  * @return string
  */
 public function format($value, ProductUnit $unit)
 {
     return $this->formatter->format($value, $unit);
 }