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.
Class for handling number conversions
This class can only handle numbers without precision

array
$_romanconvert= 'array'
Convertion table for roman signs
array
Details
__construct(
integer $value, string $type, string|\Zend_Locale $locale
=
null
)
:
void
Zend_Measure_Abstract is an abstract class for the different measurement types
Name | Type | Description |
---|---|---|
$value | integer | Value |
$type | string | (Optional) A Zend_Measure_Number Type |
$locale | string|\Zend_Locale | (Optional) A Zend_Locale |
Exception | Description |
---|---|
\Zend_Measure_Exception | When language is unknown |
\Zend_Measure_Exception | When type is unknown |

__toString(
)
:
string
Returns a string representation
Inherited from: \Zend_Measure_Abstract::__toString()Type | Description |
---|---|
string |

_fromDecimal(
integer $value, string $type
)
:
string
Convert input to type value string
Name | Type | Description |
---|---|---|
$value | integer | Input string |
$type | string | Type to convert to |
Type | Description |
---|---|
string |
Exception | Description |
---|---|
\Zend_Measure_Exception | When more than 200 digits are calculated |

_toDecimal(
integer $input, string $type
)
:
string
Convert input to decimal value string
Name | Type | Description |
---|---|---|
$input | integer | Input string |
$type | string | Type from which to convert to decimal |
Type | Description |
---|---|
string |

add(
\Zend_Measure_Abstract $object
)
:
\Zend_Measure_Abstract
Adds an unit to another one
Inherited from: \Zend_Measure_Abstract::add()Name | Type | Description |
---|---|---|
$object | \Zend_Measure_Abstract | object of same unit type |
Type | Description |
---|---|
\Zend_Measure_Abstract |

compare(
\Zend_Measure_Abstract $object
)
:
boolean
Compares two units
Inherited from: \Zend_Measure_Abstract::compare()Name | Type | Description |
---|---|---|
$object | \Zend_Measure_Abstract | object of same unit type |
Type | Description |
---|---|
boolean |

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
Name | Type | Description |
---|---|---|
$type | string | Type to convert to |
$round | integer | (Optional) Precision to add, will always be 0 |
$locale |
Type | Description |
---|---|
string |

equals(
\Zend_Measure_Abstract $object
)
:
boolean
Compare if the value and type is equal
Inherited from: \Zend_Measure_Abstract::equals()Name | Type | Description |
---|---|---|
$object | \Zend_Measure_Abstract | object to compare |
Type | Description |
---|---|
boolean |

getConversionList(
)
:
array
Returns the conversion list
Inherited from: \Zend_Measure_Abstract::getConversionList()Type | Description |
---|---|
array |

getLocale(
)
:
string
Returns the actual set locale
Inherited from: \Zend_Measure_Abstract::getLocale()Type | Description |
---|---|
string |

getType(
)
:
\type
Returns the original type
Inherited from: \Zend_Measure_Abstract::getType()Type | Description |
---|---|
\type |

getValue(
integer $round, string|\Zend_Locale $locale
=
null
)
:
integer|string
Returns the internal value
Inherited from: \Zend_Measure_Abstract::getValue()Name | Type | Description |
---|---|---|
$round | integer | (Optional) Rounds the value to an given precision, Default is -1 which returns without rounding |
$locale | string|\Zend_Locale | (Optional) Locale for number representation |
Type | Description |
---|---|
integerstring |

setLocale(
string|\Zend_Locale $locale
=
null, boolean $check
=
false
)
:
\Zend_Measure_Abstract
Sets a new locale for the value representation
Inherited from: \Zend_Measure_Abstract::setLocale()Name | Type | Description |
---|---|---|
$locale | string|\Zend_Locale | (Optional) New locale to set |
$check | boolean | False, check but don't set; True, set the new locale |
Type | Description |
---|---|
\Zend_Measure_Abstract |

setType(
string $type
)
:
void
Set a new type, and convert the value
Name | Type | Description |
---|---|---|
$type | string | New type to set |
Exception | Description |
---|---|
\Zend_Measure_Exception | When a unknown type is given |

setValue(
integer $value, string $type
=
null, string|\Zend_Locale $locale
=
null
)
:
\Zend_Measure_Abstract
Set a new value
Name | Type | Description |
---|---|---|
$value | integer | Value |
$type | string | (Optional) A Zend_Measure_Number Type |
$locale | string|\Zend_Locale | (Optional) A Zend_Locale Type |
Type | Description |
---|---|
\Zend_Measure_Abstract |
Exception | Description |
---|---|
\Zend_Measure_Exception |

sub(
\Zend_Measure_Abstract $object
)
:
\Zend_Measure_Abstract
Substracts an unit from another one
Inherited from: \Zend_Measure_Abstract::sub()Name | Type | Description |
---|---|---|
$object | \Zend_Measure_Abstract | object of same unit type |
Type | Description |
---|---|
\Zend_Measure_Abstract |

toString(
integer $round, string|\Zend_Locale $locale
=
null
)
:
string
Returns a string representation
Inherited from: \Zend_Measure_Abstract::toString()Name | Type | Description |
---|---|---|
$round | integer | (Optional) Runds the value to an given exception |
$locale | string|\Zend_Locale | (Optional) Locale to set for the number |
Type | Description |
---|---|
string |