src/Formatter/Coordinate/DecimalMinutes.php
public function format(Coordinate $coordinate): string
    {
        $lat = $coordinate->getLat();
        $lng = $coordinate->getLng();

        $latValue   = abs($lat);
        $latDegrees = (int)$latValue;

        $latMinutesDecimal = $latValue - $latDegrees;
        $latMinutes        = 60 * $latMinutesDecimal;

        $lngValue   = abs($lng);
        $lngDegrees = (int)$lngValue;

        $lngMinutesDecimal = $lngValue - $lngDegrees;
        $lngMinutes        = 60 * $lngMinutesDecimal;

        return sprintf(
            '%s%02d%s %s%s%s%s%s%03d%s %s%s%s',
            $this->getLatPrefix($lat),
            abs($latDegrees),
            $this->units[$this->unitType]['deg'],
            number_format($latMinutes, $this->digits, $this->decimalPoint, $this->decimalPoint),
            $this->units[$this->unitType]['min'],
            $this->getLatSuffix($lat),
            $this->separator,
            $this->getLngPrefix($lng),
            abs($lngDegrees),
            $this->units[$this->unitType]['deg'],
            number_format($lngMinutes, $this->digits, $this->decimalPoint, $this->decimalPoint),
            $this->units[$this->unitType]['min'],
            $this->getLngSuffix($lng)
        );
    }
public function format(Coordinate $coordinate): string
    {
        $lat = $coordinate->getLat();
        $lng = $coordinate->getLng();

        $latValue   = abs($lat);
        $latDegrees = (int)$latValue;

        $latMinutesDecimal = $latValue - $latDegrees;
        $latMinutes        = 60 * $latMinutesDecimal;

        $lngValue   = abs($lng);
        $lngDegrees = (int)$lngValue;

        $lngMinutesDecimal = $lngValue - $lngDegrees;
        $lngMinutes        = 60 * $lngMinutesDecimal;

        return sprintf(
            '%s%02d%s %s%s%s%s%s%03d%s %s%s%s',
            $this->getLatPrefix($lat),
            abs($latDegrees),
            $this->units[$this->unitType]['deg'],
            number_format($latMinutes, $this->digits, $this->decimalPoint, $this->decimalPoint),
            $this->units[$this->unitType]['min'],
            $this->getLatSuffix($lat),
            $this->separator,
            $this->getLngPrefix($lng),
            abs($lngDegrees),
            $this->units[$this->unitType]['deg'],
            number_format($lngMinutes, $this->digits, $this->decimalPoint, $this->decimalPoint),
            $this->units[$this->unitType]['min'],
            $this->getLngSuffix($lng)
        );
    }
public function format ( Coordinate $ coordinate ) : string { $ lat = $ coordinate -> getLat ( ) ; $ lng = $ coordinate -> getLng ( ) ; $ latValue = abs ( $ lat ) ; $ latDegrees = ( int ) $ latValue ; $ latMinutesDecimal = $ latValue - $ latDegrees ; $ latMinutes = 60 * $ latMinutesDecimal ; $ lngValue = abs ( $ lng ) ; $ lngDegrees = ( int ) $ lngValue ; $ lngMinutesDecimal = $ lngValue - $ lngDegrees ; $ lngMinutes = 60 * $ lngMinutesDecimal ; return sprintf ( '%s%02d%s %s%s%s%s%s%03d%s %s%s%s' , $ this -> getLatPrefix ( $ lat ) , abs ( $ latDegrees ) , $ this -> units [ $ this -> unitType ] [ 'deg' ] , number_format ( $ latMinutes , $ this -> digits , $ this -> decimalPoint , $ this -> decimalPoint ) , $ this -> units [ $ this -> unitType ] [ 'min' ] , $ this -> getLatSuffix ( $ lat ) , $ this -> separator , $ this -> getLngPrefix ( $ lng ) , abs ( $ lngDegrees ) , $ this -> units [ $ this -> unitType ] [ 'deg' ] , number_format ( $ lngMinutes , $ this -> digits , $ this -> decimalPoint , $ this -> decimalPoint ) , $ this -> units [ $ this -> unitType ] [ 'min' ] , $ this -> getLngSuffix ( $ lng ) ) ; }
@param Coordinate $coordinate

@return string
@param Coordinate $coordinate