public function parseDecimal()
    {
        $scale = $this->parseUnsignedInt8();
        $value = $this->parseSignedInt32();

        if (0 === $scale) {
            return (string)$value;
        }

        if ($value >= 0) {
            $sign = '';
            $value = (string)$value;
        } else {
            $sign = '-';
            $value = (string)-$value;
        }

        $length = strlen($value);

        if ($length === $scale) {
            return $sign . '0.' . $value;
        }

        if ($length < $scale) {
            return $sign . '0.' . str_repeat('0', $scale - $length) . $value;
        }

        return $sign . substr($value, 0, -$scale) . '.' . substr($value, -$scale);
    }
public function parseDecimal()
    {
        $scale = $this->parseUnsignedInt8();
        $value = $this->parseSignedInt32();

        if (0 === $scale) {
            return (string)$value;
        }

        if ($value >= 0) {
            $sign = '';
            $value = (string)$value;
        } else {
            $sign = '-';
            $value = (string)-$value;
        }

        $length = strlen($value);

        if ($length === $scale) {
            return $sign . '0.' . $value;
        }

        if ($length < $scale) {
            return $sign . '0.' . str_repeat('0', $scale - $length) . $value;
        }

        return $sign . substr($value, 0, -$scale) . '.' . substr($value, -$scale);
    }
public function parseDecimal ( ) { $ scale = $ this -> parseUnsignedInt8 ( ) ; $ value = $ this -> parseSignedInt32 ( ) ; if ( 0 === $ scale ) { return ( string ) $ value ; } if ( $ value >= 0 ) { $ sign = '' ; $ value = ( string ) $ value ; } else { $ sign = '-' ; $ value = ( string ) - $ value ; } $ length = strlen ( $ value ) ; if ( $ length === $ scale ) { return $ sign . '0.' . $ value ; } if ( $ length < $ scale ) { return $ sign . '0.' . str_repeat ( '0' , $ scale - $ length ) . $ value ; } return $ sign . substr ( $ value , 0 , - $ scale ) . '.' . substr ( $ value , - $ scale ) ; }
Parse an AMQP decimal from the head of the buffer.
@return string
Parse an AMQP decimal from the head of the buffer .