Index: db_tag_processor.php =================================================================== --- db_tag_processor.php (revision 13756) +++ db_tag_processor.php (working copy) @@ -2333,8 +2333,23 @@ function FieldTotal($params) { $list =& $this->GetList($params); + $field = $this->SelectParam($params, 'field,name'); + $total_function = $params['function']; - return $list->GetFormattedTotal($this->SelectParam($params, 'field,name'), $params['function']); + if (array_key_exists('currency', $params) && $params['currency']) { + $iso = $this->GetISO($params['currency']); + $original = $list->getTotal($field, $total_function); + $value = $this->ConvertCurrency($original, $iso); + $list->setTotal($field, $total_function, $value); + } + + $value = $list->GetFormattedTotal($field, $total_function); + + if (array_key_exists('currency', $params) && $params['currency']) { + $value = $this->AddCurrencySymbol($value, $iso); + } + + return $value; } /** Index: dblist.php =================================================================== --- dblist.php (revision 13756) +++ dblist.php (working copy) @@ -457,10 +457,18 @@ function getTotal($field, $total_function) { - if (!$this->TotalsCalculated) $this->CalculateTotals(); - return $this->Totals[$field.'_'.$total_function]; + if (!$this->TotalsCalculated) { + $this->CalculateTotals(); + } + + return $this->Totals[$field . '_' . $total_function]; } + function setTotal($field, $total_function, $value) + { + $this->Totals[$field . '_' . $total_function] = $value; + } + function GetFormattedTotal($field, $total_function) { $val = $this->getTotal($field, $total_function);