public function getPercent(): float
    {
        $amount = $this->getAmount();

        if (0 < $this->sellingPrice) {
            return round($amount * 100 / $this->sellingPrice, 2);
        }

        return 0;
    }
public function getPercent(): float
    {
        $amount = $this->getAmount();

        if (0 < $this->sellingPrice) {
            return round($amount * 100 / $this->sellingPrice, 2);
        }

        return 0;
    }
public function getPercent ( ) : float { $ amount = $ this -> getAmount ( ) ; if ( 0 < $ this -> sellingPrice ) { return round ( $ amount * 100 / $ this -> sellingPrice , 2 ) ; } return 0 ; }
Returns the percentage.

@return float
Returns the percentage .