. */ /** * Money column */ class MoneyColumn extends TextColumn { private $currency; /** * Constructor * * @param string name of the column (as provided in the parameter of getCellValue()) * @param string header value */ public function __construct($name, $header, $currency="€") { parent::__construct($name, $header); $this->currency = $currency; } public function getCellValue($rowNum, $row) { if( $row[$this->name] == null || $row[$this->name] == 0 ) { return ""; }else { setlocale(LC_MONETARY, 'nl_NL'); return $this->currency . " " . str_replace(" ", "  ", money_format("%!^#3.2n", $row[$this->name])); } } } ?>