<commit_before><?php

require_once 'Swat/SwatCellRenderer.php';
require_once 'Swat/SwatString.php';

/**
 * A currency cell renderer
 *
 * @package   Swat
 * @copyright 2004-2005 silverorange
 * @license   http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
 */
class SwatMoneyCellRenderer extends SwatCellRenderer
{
	// {{{ public properties

	/**
	 * Optional locale for currency format
	 *
	 * @var string
	 */
	public $locale = null;

	/**
	 * Monetary value
	 * 
	 * @var string
	 */
	public $value;

	// }}}
	// {{{ public function render()

	/**
	 * Renders the contents of this cell
	 *
	 * @see SwatCellRenderer::render()
	 */
	public function render()
	{
		echo SwatString::minimizeEntities(
			SwatString::moneyFormat($this->value, $this->locale));<commit_msg>Fixup SwatMoneyCellRenderer: 	Add $display_currency property. 	Add CSS class swat-money-cell-renderer: Steven, can you align this to the right?<commit_after><?php

require_once 'Swat/SwatCellRenderer.php';
require_once 'Swat/SwatString.php';

/**
 * A currency cell renderer
 *
 * @package   Swat
 * @copyright 2004-2005 silverorange
 * @license   http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
 */
class SwatMoneyCellRenderer extends SwatCellRenderer
{
	// {{{ public properties

	/**
	 * Optional locale for currency format
	 *
	 * @var string
	 */
	public $locale = null;

	/**
	 * Monetary value
	 * 
	 * @var float
	 */
	public $value;

	/**
	 * Whether to display currency unit
	 *
	 * If true, displays the international currency unit
	 *
	 * @var boolean
	 */
	public $display_currency = false;

	// }}}
	// {{{ public function render()

	/**
	 * Renders the contents of this cell
	 *
	 * @see SwatCellRenderer::render()
	 */
	public function render()
	{
		echo SwatString::minimizeEntities(
			SwatString::moneyFormat(
				$this->value, $this->locale, $this->display_currency));
	}

	// }}}
	// {{{ public function getTdAttributes()

	/**
	 * Gets TD-tag attributes
	 *
	 * @return array an array of attributes to apply to the TD tag of this cell
	 *                renderer.
	 *
	 * @see SwatCellRenderer::getTdAttributes()
	 */
	public function getTdAttributes()
	{
		return array('class' => 'swat-money-cell-renderer');
	}

	// }}}
	// {{{ public function getThAttributes()

	/**
	 * Gets TH-tag attributes
	 *
	 * @return array an array of attributes to apply to the TH tag in the
	 *                table header for this cell renderer.
	 *
	 * @see SwatCellRenderer::getThAttributes()
	 */
	public function getThAttributes()
	{
		return array('class' => 'swat-money-cell-renderer');
{'fraction_non_alphanumeric': 0.1332300542215337, 'fraction_numerical': 0.0077459333849728895, 'mean_word_length': 3.2068403908794787, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4486982', 'n_tokens_mistral': 893, 'n_tokens_neox': 797, 'n_words': 216}