Browse Source

money default in rubles

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@43 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
master
pzinovkin 16 years ago
parent
commit
47e33759d8
  1. 4
      classes/Format.class.php

4
classes/Format.class.php

@ -47,8 +47,12 @@ class Format
static public function money2int($money) static public function money2int($money)
{ {
if(!isset(self::$cache_money[$money])){ if(!isset(self::$cache_money[$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); self::$cache_money[$money] = (int)str_replace(array('.', self::$decimal_point), '', $money);
} }
}
return self::$cache_money[$money]; return self::$cache_money[$money];
} }

Loading…
Cancel
Save