src/Converter.php
public function getMeasurement($measurement, $default = null)
    {
        $measurements = $this->getMeasurements();

        $measure = array_get($measurements, $measurement, $default);

        if (is_null($measure)) {
            if (str_contains($measurement, 'negative')) {
                return '-' . $this->getMeasurement(str_replace('negative', 'format', $measurement));
            }

            if (str_contains($measurement, 'currency')) {
                $currency = explode('.', $measurement);

                return $this->exchanger->get($currency[1]);
            }

            throw new Exception("Measurement [{$measurement}] was not found.");
        }

        return $measure;
    }
public function getMeasurement($measurement, $default = null)
    {
        $measurements = $this->getMeasurements();

        $measure = array_get($measurements, $measurement, $default);

        if (is_null($measure)) {
            if (str_contains($measurement, 'negative')) {
                return '-' . $this->getMeasurement(str_replace('negative', 'format', $measurement));
            }

            if (str_contains($measurement, 'currency')) {
                $currency = explode('.', $measurement);

                return $this->exchanger->get($currency[1]);
            }

            throw new Exception("Measurement [{$measurement}] was not found.");
        }

        return $measure;
    }
public function getMeasurement ( $ measurement , $ default = null ) { $ measurements = $ this -> getMeasurements ( ) ; $ measure = array_get ( $ measurements , $ measurement , $ default ) ; if ( is_null ( $ measure ) ) { if ( str_contains ( $ measurement , 'negative' ) ) { return '-' . $ this -> getMeasurement ( str_replace ( 'negative' , 'format' , $ measurement ) ) ; } if ( str_contains ( $ measurement , 'currency' ) ) { $ currency = explode ( '.' , $ measurement ) ; return $ this -> exchanger -> get ( $ currency [ 1 ] ) ; } throw new Exception ( "Measurement [{$measurement}] was not found." ) ; } return $ measure ; }
Returns information about the given measurement.

@param  string  $measurement
@param  mixed  $default
@return mixed
@throws \Exception
Returns information about the given measurement .