// получение стоимости числом и строкой в отформатированном виде в заданной валюте ($key == 'value' - возвращается только значение, $key == 'formatted' - возвращается только отформатированная строка)
public static function GetPrice($key, $price, $currency = 'base') {
$r = array();
if ($price == '') $price = 0;
$r[$key] = $price;
if (class_exists('edost_currency') && method_exists('edost_currency', 'convert')) $price = edost_currency::convert($price, $currency);
if ($key != 'value')
if (class_exists('edost_currency') && method_exists('edost_currency', 'format')) $r[$key.'_formatted'] = ($price == '0' ? '0' : edost_currency::format($price));
else $r[$key.'_formatted'] = ($price == '0' ? '0' : self::draw_digit($price).' '.self::site_charset('руб.', 'utf'));
if ($key == 'value') return $price;
if ($key == 'formatted') return $r[$key.'_formatted'];
return $r;
}
вот код