src/Carbon/Traits/Date.php
public function ordinal(string $key, string $period = null): string
    {
        $number = $this->$key;
        $result = $this->translate('ordinal', [
            ':number' => $number,
            ':period' => $period,
        ]);

        return strval($result === 'ordinal' ? $number : $result);
    }
public function ordinal(string $key, string $period = null): string
    {
        $number = $this->$key;
        $result = $this->translate('ordinal', [
            ':number' => $number,
            ':period' => $period,
        ]);

        return strval($result === 'ordinal' ? $number : $result);
    }
public function ordinal ( string $ key , string $ period = null ) : string { $ number = $ this -> $ key ; $ result = $ this -> translate ( 'ordinal' , [ ':number' => $ number , ':period' => $ period , ] ) ; return strval ( $ result === 'ordinal' ? $ number : $ result ) ; }
Return a property with its ordinal.

@param string      $key
@param string|null $period

@return string
Return a property with its ordinal .