API Documentation

Measure/Number.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Measure
version
$Id: Number.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Measure_Number

Description

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.

Zend_Measure_Number

Extends from
Zend_Measure_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Measure
subpackage
Zend_Measure_Number
Constants
STANDARD
BINARY
TERNARY
QUATERNARY
QUINARY
SENARY
SEPTENARY
OCTAL
NONARY
DECIMAL
DUODECIMAL
HEXADECIMAL
ROMAN
Properties
$_units
$_roman
$_romanconvert
Methods
__construct
setValue
_toDecimal
_fromDecimal
setType
convertTo

Description

Class for handling number conversions

This class can only handle numbers without precision

Constants

STANDARD

 STANDARD = 'DECIMAL'

Details

value
DECIMAL

BINARY

 BINARY = 'BINARY'

Details

value
BINARY

TERNARY

 TERNARY = 'TERNARY'

Details

value
TERNARY

QUATERNARY

 QUATERNARY = 'QUATERNARY'

Details

value
QUATERNARY

QUINARY

 QUINARY = 'QUINARY'

Details

value
QUINARY

SENARY

 SENARY = 'SENARY'

Details

value
SENARY

SEPTENARY

 SEPTENARY = 'SEPTENARY'

Details

value
SEPTENARY

OCTAL

 OCTAL = 'OCTAL'

Details

value
OCTAL

NONARY

 NONARY = 'NONARY'

Details

value
NONARY

DECIMAL

 DECIMAL = 'DECIMAL'

Details

value
DECIMAL

DUODECIMAL

 DUODECIMAL = 'DUODECIMAL'

Details

value
DUODECIMAL

HEXADECIMAL

 HEXADECIMAL = 'HEXADECIMAL'

Details

value
HEXADECIMAL

ROMAN

 ROMAN = 'ROMAN'

Details

value
ROMAN

Properties

$_roman

array $_roman = 'array'

Definition of all roman signs

Details

$_roman
array
visibility
private
default
array
final
false
static
true

$_romanconvert

array $_romanconvert = 'array'

Convertion table for roman signs

Details

$_romanconvert
array
visibility
private
default
array
final
false
static
true

$_units

array $_units = 'array'

Calculations for all number units

Details

$_units
array
visibility
protected
default
array
final
false
static
false

Methods

__construct

__construct( integer $value, string $type, string|Zend_Locale $locale = null ) :

Zend_Measure_Abstract is an abstract class for the different measurement types

Arguments
$value
integer
Value
$type
string
(Optional) A Zend_Measure_Number Type
$locale
stringZend_Locale
(Optional) A Zend_Locale
Details
visibility
public
final
false
static
false
throws
When language is unknown
throws
When type is unknown

_fromDecimal

_fromDecimal( integer $value, string $type ) : string

Convert input to type value string

Arguments
$value
integer
Input string
$type
string
Type to convert to
Output
string
Details
visibility
private
final
false
static
false
throws
When more than 200 digits are calculated

_toDecimal

_toDecimal( integer $input, string $type ) : string

Convert input to decimal value string

Arguments
$input
integer
Input string
$type
string
Type from which to convert to decimal
Output
string
Details
visibility
private
final
false
static
false

convertTo

convertTo( 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

Arguments
$type
string
Type to convert to
$round
integer
(Optional) Precision to add, will always be 0
$locale
Output
string
Details
visibility
public
final
false
static
false

setType

setType( string $type ) : void

Set a new type, and convert the value

Arguments
$type
string
New type to set
Details
visibility
public
final
false
static
false
throws
When a unknown type is given

setValue

setValue( integer $value, string $type = null, string|Zend_Locale $locale = null ) :

Set a new value

Arguments
$value
integer
Value
$type
string
(Optional) A Zend_Measure_Number Type
$locale
stringZend_Locale
(Optional) A Zend_Locale Type
Details
visibility
public
final
false
static
false
throws
Documentation was generated by DocBlox.