value = $val; } /** * Return type of the element. * * @return integer */ public function getType() { return Zend_Pdf_Element::TYPE_NUMERIC; } /** * Return object as string * * @param Zend_Pdf_Factory $factory * @return string */ public function toString($factory = null) { if (is_integer($this->value)) { return (string)$this->value; } /** * PDF doesn't support exponental format. * Fixed point format must be used instead */ $prec = 0; $v = $this->value; while (abs( floor($v) - $v ) > 1e-10) { $prec++; $v *= 10; } return sprintf("%.{$prec}F", $this->value); } }