public function asShortLength($value, $decimals = null, $options = [], $textOptions = [])
    {
        if ($value === null) {
            return $this->nullDisplay;
        }

        list($params, $position) = $this->formatSiNumber($value, $decimals, 2, $options, $textOptions);

        switch ($position) {
            case 0:
                return Yii::t('app', '{nFormatted} mm', $params, $this->locale);
            case 1:
                return Yii::t('app', '{nFormatted} m', $params, $this->locale);
            default:
                return Yii::t('app', '{nFormatted} km', $params, $this->locale);
        }
    }
public function asShortLength($value, $decimals = null, $options = [], $textOptions = [])
    {
        if ($value === null) {
            return $this->nullDisplay;
        }

        list($params, $position) = $this->formatSiNumber($value, $decimals, 2, $options, $textOptions);

        switch ($position) {
            case 0:
                return Yii::t('app', '{nFormatted} mm', $params, $this->locale);
            case 1:
                return Yii::t('app', '{nFormatted} m', $params, $this->locale);
            default:
                return Yii::t('app', '{nFormatted} km', $params, $this->locale);
        }
    }
public function asShortLength ( $ value , $ decimals = null , $ options = [ ] , $ textOptions = [ ] ) { if ( $ value === null ) { return $ this -> nullDisplay ; } list ( $ params , $ position ) = $ this -> formatSiNumber ( $ value , $ decimals , 2 , $ options , $ textOptions ) ; switch ( $ position ) { case 0 : return Yii :: t ( 'app' , '{nFormatted} mm' , $ params , $ this -> locale ) ; case 1 : return Yii :: t ( 'app' , '{nFormatted} m' , $ params , $ this -> locale ) ; default : return Yii :: t ( 'app' , '{nFormatted} km' , $ params , $ this -> locale ) ; } }
Formats the value in milimeters as a length in human readable form for example `12 m`.

This is the short form of [[asLength]].

@param integer $value value in milimeters to be formatted.
@param integer $decimals the number of digits after the decimal point.
@param array $options optional configuration for the number formatter.
This parameter will be merged with [[numberFormatterOptions]].
@param array $textOptions optional configuration for the number formatter.
This parameter will be merged with [[numberFormatterTextOptions]].
@return string the formatted result.
@throws InvalidParamException if the input value is not numeric or the formatting failed.
@see asWeight
Formats the value in milimeters as a length in human readable form for example 12 m .