Skip to content

Instantly share code, notes, and snippets.

@bueckl
Created April 10, 2015 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bueckl/432281402e23f92d4446 to your computer and use it in GitHub Desktop.
Save bueckl/432281402e23f92d4446 to your computer and use it in GitHub Desktop.
Currency EUR quick and dirt #SS3
<?php
class CurrencyEuro extends Currency {
protected static $currencySymbol = '€';
public function Nice() {
$val = number_format(abs($this->value), 2, ',', '.') . '&nbsp;' . self::$currencySymbol;
if($this->value < 0) return "($val)";
else return $val;
}
}
// _config.php
Object::useCustomClass('Currency','CurrencyEuro', true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment