evseevnn\Cassandra\Protocol\Response\DataStream::readDecimal PHP Method

readDecimal() public method

Read variable length decimal.
public readDecimal ( boolean $isCollectionElement = false ) : string
$isCollectionElement boolean
return string
    public function readDecimal($isCollectionElement = false)
    {
        if ($isCollectionElement) {
            $this->readShort();
        }
        $scale = $this->readInt();
        $value = $this->readVarint($isCollectionElement);
        $len = strlen($value);
        return substr($value, 0, $len - $scale) . '.' . substr($value, $len - $scale);
    }