From 47e33759d88baa1c3bdb94e5e0bd7493042266bf Mon Sep 17 00:00:00 2001 From: pzinovkin Date: Thu, 15 Jan 2009 14:55:54 +0000 Subject: [PATCH] money default in rubles git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@43 4cb57b5f-5bbd-dd11-951b-001d605cbbc5 --- classes/Format.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/Format.class.php b/classes/Format.class.php index de11d9a..65c1d2b 100644 --- a/classes/Format.class.php +++ b/classes/Format.class.php @@ -47,7 +47,11 @@ class Format static public function money2int($money) { if(!isset(self::$cache_money[$money])){ - self::$cache_money[$money] = (int)str_replace(array('.', self::$decimal_point), '', $money); + if(!strstr($money, self::$decimal_point) && !strstr($money, '.')){ + self::$cache_money[$money] = (int)$money * 100; + }else{ + self::$cache_money[$money] = (int)str_replace(array('.', self::$decimal_point), '', $money); + } } return self::$cache_money[$money]; }