API Documentation

Zend/Measure/Number.php

Show: inherited
Table of Contents

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Measure  
Version
$Id: Number.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Measure_Number

Package: Zend\Measure\Zend\Measure\Number

Class for handling number conversions

This class can only handle numbers without precision

Parent(s)
\Zend_Measure_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constant  STANDARD = 'DECIMAL'
Constant  BINARY = 'BINARY'
Constant  TERNARY = 'TERNARY'
Constant  QUATERNARY = 'QUATERNARY'
Constant  QUINARY = 'QUINARY'
Constant  SENARY = 'SENARY'
Constant  SEPTENARY = 'SEPTENARY'
Constant  OCTAL = 'OCTAL'
Constant  NONARY = 'NONARY'
Constant  DECIMAL = 'DECIMAL'
Constant  DUODECIMAL = 'DUODECIMAL'
Constant  HEXADECIMAL = 'HEXADECIMAL'
Constant  ROMAN = 'ROMAN'

Properties

Propertyprivatearray  $_roman= 'array( 'I' => 1'
static

Definition of all roman signs

Default valuearray( 'I' => 1Details
Type
array
Propertyprivatearray  $_romanconvert= 'array( '/_V/' => '/P/''
static

Convertion table for roman signs

Default valuearray( '/_V/' => '/P/'Details
Type
array
Propertyprotectedarray  $_units= 'array( 'BINARY' => array(2'

Calculations for all number units

Default valuearray( 'BINARY' => array(2Details
Type
array

Methods

methodpublic__construct( integer $value, string $type, string|\Zend_Locale $locale = null ) : void

Zend_Measure_Abstract is an abstract class for the different measurement types

Parameters
Name Type Description
$value integer

Value

$type string

(Optional) A Zend_Measure_Number Type

$locale string|\Zend_Locale

(Optional) A Zend_Locale

Throws
Exception Description
\Zend_Measure_Exception When language is unknown
\Zend_Measure_Exception When type is unknown
methodprivate_fromDecimal( integer $value, string $type ) : string

Convert input to type value string

Parameters
Name Type Description
$value integer

Input string

$type string

Type to convert to

Returns
Type Description
string
Throws
Exception Description
\Zend_Measure_Exception When more than 200 digits are calculated
methodprivate_toDecimal( integer $input, string $type ) : string

Convert input to decimal value string

Parameters
Name Type Description
$input integer

Input string

$type string

Type from which to convert to decimal

Returns
Type Description
string
methodpublicconvertTo( string $type, integer $round = 0,  $locale = null ) : string

Alias function for setType returning the converted unit Default is 0 as this class only handles numbers without precision

Parameters
Name Type Description
$type string

Type to convert to

$round integer

(Optional) Precision to add, will always be 0

$locale
Returns
Type Description
string
methodpublicsetType( string $type ) : void

Set a new type, and convert the value

Parameters
Name Type Description
$type string

New type to set

Throws
Exception Description
\Zend_Measure_Exception When a unknown type is given
methodpublicsetValue( integer $value, string $type = null, string|\Zend_Locale $locale = null ) : void

Set a new value

Parameters
Name Type Description
$value integer

Value

$type string

(Optional) A Zend_Measure_Number Type

$locale string|\Zend_Locale

(Optional) A Zend_Locale Type

Throws
Exception Description
\Zend_Measure_Exception
Documentation was generated by DocBlox 0.15.1.