View/Helper/TableHelper.php
protected function _replaceCurrency($str) {
		if (!preg_match_all('/\[currency(.*?)\](.*)\[\/currency\]/i', $str, $matches)) {
			// Fallback regex for when no options are passed.
			if (!preg_match_all('/\[currency(.*?)\](.[^\[]*)\[\/currency\]/i', $str, $matches)) {
				return $str;
			}
		}

		foreach ($matches[0] as $i => $find) {
			$opts = $this->_extractAttributes(trim($matches[1][$i]));

			$currency = CakeNumber::defaultCurrency();
			if (isset($opts['currency'])) {
				$currency = $opts['currency'];
				unset($opts['currency']);
			}

			$replace = (empty($matches[2][$i]) || !is_numeric($matches[2][$i])) ? '' : CakeNumber::currency($matches[2][$i], $currency, $opts);
			$str = str_replace($find, $replace, $str);
		}

		return $str;
	}
protected function _replaceCurrency($str) {
		if (!preg_match_all('/\[currency(.*?)\](.*)\[\/currency\]/i', $str, $matches)) {
			// Fallback regex for when no options are passed.
			if (!preg_match_all('/\[currency(.*?)\](.[^\[]*)\[\/currency\]/i', $str, $matches)) {
				return $str;
			}
		}

		foreach ($matches[0] as $i => $find) {
			$opts = $this->_extractAttributes(trim($matches[1][$i]));

			$currency = CakeNumber::defaultCurrency();
			if (isset($opts['currency'])) {
				$currency = $opts['currency'];
				unset($opts['currency']);
			}

			$replace = (empty($matches[2][$i]) || !is_numeric($matches[2][$i])) ? '' : CakeNumber::currency($matches[2][$i], $currency, $opts);
			$str = str_replace($find, $replace, $str);
		}

		return $str;
	}
protected function _replaceCurrency ( $ str ) { if ( ! preg_match_all ( '/\[currency(.*?)\](.*)\[\/currency\]/i' , $ str , $ matches ) ) { // Fallback regex for when no options are passed. if ( ! preg_match_all ( '/\[currency(.*?)\](.[^\[]*)\[\/currency\]/i' , $ str , $ matches ) ) { return $ str ; } } foreach ( $ matches [ 0 ] as $ i => $ find ) { $ opts = $ this -> _extractAttributes ( trim ( $ matches [ 1 ] [ $ i ] ) ) ; $ currency = CakeNumber :: defaultCurrency ( ) ; if ( isset ( $ opts [ 'currency' ] ) ) { $ currency = $ opts [ 'currency' ] ; unset ( $ opts [ 'currency' ] ) ; } $ replace = ( empty ( $ matches [ 2 ] [ $ i ] ) || ! is_numeric ( $ matches [ 2 ] [ $ i ] ) ) ? '' : CakeNumber :: currency ( $ matches [ 2 ] [ $ i ] , $ currency , $ opts ) ; $ str = str_replace ( $ find , $ replace , $ str ) ; } return $ str ; }
Replace by formatted currency string.

Examples:
- [currency]50[/currency]
- [currency zero="$0.00"]0[/currency]

@param string $str String to check and modify.
@return string Modified string.
Replace by formatted currency string .