diff --git a/core/model/fieldtypes/Money.php b/core/model/fieldtypes/Money.php index ce954b052..1097985c1 100644 --- a/core/model/fieldtypes/Money.php +++ b/core/model/fieldtypes/Money.php @@ -131,6 +131,9 @@ class Money extends DBField implements CompositeDBField { */ function Nice($options = array()) { $amount = $this->getAmount(); + if(!isset($options['display'])) $options['display'] = Zend_Currency::USE_SYMBOL; + if(!isset($options['currency'])) $options['currency'] = $this->getCurrency(); + if(!isset($options['symbol'])) $options['symbol'] = $this->currencyLib->getSymbol($this->getCurrency(), $this->getLocale()); return (is_numeric($amount)) ? $this->currencyLib->toCurrency($amount, $options) : ''; } diff --git a/tests/model/MoneyTest.php b/tests/model/MoneyTest.php index e2d87c9e0..bd64cefa4 100644 --- a/tests/model/MoneyTest.php +++ b/tests/model/MoneyTest.php @@ -117,7 +117,6 @@ class MoneyTest extends SapphireTest { } */ - /* $INR = new Money(); $INR->setLocale('de_AT'); $INR->setCurrency('INR'); @@ -129,7 +128,6 @@ class MoneyTest extends SapphireTest { $this->assertSame('Rs. 0,00', $INR->Nice()); $INR->setAmount(-3); $this->assertSame('-Rs. 3,00', $INR->Nice()); - */ } public function testGetSign() {