mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: pass-in the params in right order when constructing of Zend_Currency in Money Constructor. Add NiceWithShortname function.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76299 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b20b6e0f95
commit
b50d564a5c
@ -65,7 +65,7 @@ class Money extends DBField implements CompositeDBField {
|
||||
);
|
||||
|
||||
function __construct($name = null) {
|
||||
$this->currencyLib = new Zend_Currency(i18n::default_locale());
|
||||
$this->currencyLib = new Zend_Currency(null, i18n::default_locale());
|
||||
|
||||
parent::__construct($name);
|
||||
}
|
||||
@ -118,6 +118,15 @@ class Money extends DBField implements CompositeDBField {
|
||||
return $this->currencyLib->toCurrency($this->getAmount(), $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
function NiceWithShortname($options = array()){
|
||||
$shortName = $this->getShortName();
|
||||
$symbol = $this->getSymbol();
|
||||
return $shortName."(".$symbol.")"." ".$this->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user