Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
Zend_Pdf_Element_Numeric Class Reference
Inheritance diagram for Zend_Pdf_Element_Numeric:
Zend_Pdf_Element

Public Member Functions

 __construct ($val)
 
 getType ()
 
 toString ($factory=null)
 
- Public Member Functions inherited from Zend_Pdf_Element
 getType ()
 
 toString ($factory=null)
 
 makeClone (Zend_Pdf_ElementFactory $factory, array &$processed, $mode)
 
 setParentObject (Zend_Pdf_Element_Object $parent)
 
 getParentObject ()
 
 touch ()
 
 cleanUp ()
 
 toPhp ()
 

Data Fields

 $value
 
- Data Fields inherited from Zend_Pdf_Element
const TYPE_BOOL = 1
 
const TYPE_NUMERIC = 2
 
const TYPE_STRING = 3
 
const TYPE_NAME = 4
 
const TYPE_ARRAY = 5
 
const TYPE_DICTIONARY = 6
 
const TYPE_STREAM = 7
 
const TYPE_NULL = 11
 
const CLONE_MODE_SKIP_PAGES = 1
 
const CLONE_MODE_FORCE_CLONING = 2
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Pdf_Element
static phpToPdf ($input)
 

Detailed Description

Definition at line 35 of file Numeric.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $val)

Object constructor

Parameters
numeric$val
Exceptions
Zend_Pdf_Exception

Definition at line 51 of file Numeric.php.

52  {
53  if ( !is_numeric($val) ) {
54  #require_once 'Zend/Pdf/Exception.php';
55  throw new Zend_Pdf_Exception('Argument must be numeric');
56  }
57 
58  $this->value = $val;
59  }
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9

Member Function Documentation

◆ getType()

getType ( )

Return type of the element.

Returns
integer

Definition at line 67 of file Numeric.php.

68  {
70  }
const TYPE_NUMERIC
Definition: Element.php:33

◆ toString()

toString (   $factory = null)

Return object as string

Parameters
Zend_Pdf_Factory$factory
Returns
string

PDF doesn't support exponental format. Fixed point format must be used instead

Definition at line 79 of file Numeric.php.

80  {
81  if (is_integer($this->value)) {
82  return (string)$this->value;
83  }
84 
89  $prec = 0; $v = $this->value;
90  while (abs( floor($v) - $v ) > 1e-10) {
91  $prec++; $v *= 10;
92  }
93  return sprintf("%.{$prec}F", $this->value);
94  }
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9

Field Documentation

◆ $value

Definition at line 42 of file Numeric.php.


The documentation for this class was generated from the following file: