From 05e28d52bdc70cef963f30508dfe9e93639649e2 Mon Sep 17 00:00:00 2001 From: aterekhov Date: Tue, 17 Nov 2009 22:07:38 +0000 Subject: [PATCH] Currence format   #14 git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@110 4cb57b5f-5bbd-dd11-951b-001d605cbbc5 --- classes/Format.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/classes/Format.class.php b/classes/Format.class.php index 3de49f8..d47e8fd 100644 --- a/classes/Format.class.php +++ b/classes/Format.class.php @@ -35,7 +35,7 @@ class Format { return self::$currency_symbol; } - + public static function setCurrencySymbol($symbol) { self::$currency_symbol = $symbol; @@ -51,7 +51,11 @@ class Format static public function int2money($int = 0, $currency = false, $show_decimals = true) { $money = number_format($int/100, ($show_decimals) ? self::$frac_digits : 0, self::$decimal_point, ' '); - return str_replace(' ', html_entity_decode(' ', ENT_COMPAT, 'UTF-8'), $money) . (($currency) ? ' ' . self::$currency_symbol : ''); + if ($currency) { + return str_replace(' ', html_entity_decode(' ', ENT_COMPAT, 'UTF-8'), $money) . (($currency) ? ' ' . self::$currency_symbol : ''); + } else { + return $money . (($currency) ? ' ' . self::$currency_symbol : ''); + } } static public function money2int($money)