Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezcurrency.php
Go to the documentation of this file.
1 <?php
32 class eZCurrency
33 {
40 public function __construct( $value )
41 {
42 if ( $value instanceof eZCurrency )
43 {
44 $value = $value->value();
45 }
46 $this->Value = $value;
47 $this->Locale = eZLocale::instance();
48 }
49
53 function setLocale( &$locale )
54 {
55 $this->Locale =& $locale;
56 }
57
64 function adjustValue( $old_scale, $new_scale )
65 {
66 $this->Value = ( $this->Value * $new_scale ) / $old_scale;
67 }
68
72 function setValue( $value )
73 {
74 $this->Value =& $value;
75 }
76
80 function locale()
81 {
82 return $this->Locale;
83 }
84
88 function value()
89 {
90 return $this->Value;
91 }
92
96 function symbol()
97 {
98 return $this->Locale->currencySymbol();
99 }
100
104 function name()
105 {
106 return $this->Locale->currencyName();
107 }
108
112 function shortName()
113 {
114 return $this->Locale->currencyShortName();
115 }
116
120 function toString()
121 {
122 return $this->Locale->formatCurrency( $this->Value );
123 }
124
126 public $Value;
128 public $Locale;
129 }
130
131 ?>
eZCurrency
Locale aware currency class.
Definition: ezcurrency.php:33
eZCurrency\setValue
setValue( $value)
Definition: ezcurrency.php:72
eZCurrency\adjustValue
adjustValue( $old_scale, $new_scale)
Definition: ezcurrency.php:64
eZCurrency\locale
locale()
Definition: ezcurrency.php:80
eZCurrency\toString
toString()
Definition: ezcurrency.php:120
eZCurrency\symbol
symbol()
Definition: ezcurrency.php:96
eZCurrency\$Locale
$Locale
The current locale object.
Definition: ezcurrency.php:128
eZCurrency\shortName
shortName()
Definition: ezcurrency.php:112
eZCurrency\value
value()
Definition: ezcurrency.php:88
eZCurrency\name
name()
Definition: ezcurrency.php:104
eZCurrency\$Value
$Value
The currency value.
Definition: ezcurrency.php:126
eZCurrency\__construct
__construct( $value)
Definition: ezcurrency.php:40
eZCurrency\setLocale
setLocale(&$locale)
Definition: ezcurrency.php:53
eZLocale\instance
static instance( $localeString=false)
Definition: ezlocale.php:1536
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.