$n) { preg_match('/^.{1,260}\b/s', $str, $matches); return rtrim($matches[0]) ; } else { return $str; } } function format_price($amount, $currency, $mantisa = 0) { if (null === $amount) { return null; } $currency = (string) $currency; $strm = ''; if($mantisa > 0) { $strm = '.'.str_repeat('0', $mantisa); } switch($currency) { case 'CZK': $pattern = '#,##0'.$strm.' ¤'; break; default: $pattern = '#,##0.00 ¤'; break; } $numberFormat = new sfNumberFormat(sfContext::getInstance()->getUser()->getCulture()); return $numberFormat->format($amount, $pattern, $currency); }