diff --git a/core/model/fieldtypes/Currency.php b/core/model/fieldtypes/Currency.php index 7c234982c..5948747cf 100644 --- a/core/model/fieldtypes/Currency.php +++ b/core/model/fieldtypes/Currency.php @@ -12,16 +12,17 @@ * @subpackage model */ class Currency extends Decimal { + protected static $currencySymbol = '$'; function Nice() { // return "value\">$" . number_format($this->value, 2) . ''; - $val = '$' . number_format(abs($this->value), 2); + $val = self::$currencySymbol . number_format(abs($this->value), 2); if($this->value < 0) return "($val)"; else return $val; } function Whole() { - $val = '$' . number_format(abs($this->value), 0); + $val = self::$currencySymbol . number_format(abs($this->value), 0); if($this->value < 0) return "($val)"; else return $val; } @@ -32,12 +33,16 @@ class Currency extends Decimal { $this->value = $value; } else if(preg_match('/-?\$?[0-9,]+(.[0-9]+)?([Ee][0-9]+)?/', $value, $matches)) { - $this->value = str_replace(array('$',','),'',$matches[0]); + $this->value = str_replace(array('$',',',self::$currencySymbol),'',$matches[0]); } else { $this->value = 0; } } + + static function setCurrencySymbol($value) { + self::$currencySymbol = $value; + } } ?> \ No newline at end of file