src/Sasedev/ExtraToolsBundle/Twig/TwigExtension.php
public function convertFilter($value, $sourceUnit, $destinationUnit, $unitName, $locale = null)
	{
		if (null !== $value) {
			$translatedUnitName = $this->translator->trans($unitName, array(), 'SasedevExtraToolsBundle');

			$value = $this->converter->convert($value, $sourceUnit, $destinationUnit, $locale);
			$value = $value . ' ' . $translatedUnitName;
		}

		return $value;
	}
public function convertFilter($value, $sourceUnit, $destinationUnit, $unitName, $locale = null)
	{
		if (null !== $value) {
			$translatedUnitName = $this->translator->trans($unitName, array(), 'SasedevExtraToolsBundle');

			$value = $this->converter->convert($value, $sourceUnit, $destinationUnit, $locale);
			$value = $value . ' ' . $translatedUnitName;
		}

		return $value;
	}
public function convertFilter ( $ value , $ sourceUnit , $ destinationUnit , $ unitName , $ locale = null ) { if ( null !== $ value ) { $ translatedUnitName = $ this -> translator -> trans ( $ unitName , array ( ) , 'SasedevExtraToolsBundle' ) ; $ value = $ this -> converter -> convert ( $ value , $ sourceUnit , $ destinationUnit , $ locale ) ; $ value = $ value . ' ' . $ translatedUnitName ; } return $ value ; }
Convert a value into another unit.
Returns null if fails or not supported.

@param mixed $value
@param string $sourceUnit
@param string $destinationUnit
@param
string the locale (optional)
@return string|null The converted value
Convert a value into another unit . Returns null if fails or not supported .