I'm using zend currency to display the currency based on locale. When I use the following code the symbol gets replaced by 1 instead of simply being removed:
$currency = new Zend_Currency($locale); $currency->setFormat(array('symbol' => Zend_Currency::NO_SYMBOL));
What normally gets returned is this: € 2.500,01 but after the "setFormat" call I'm getting this: 1 2.500,01
I don't want the "1 " in there.
Any ideas on how to fix this?
Thanks.
Here's the ZF tutorial page for this. It looks like it will set a person in the right direction: zend currency tutorial page
You're setting the wrong option in setFormat. You need to set
display
toZend_Currency::NO_SYMBOL
. Like this:Which outputs
The way you are currently doing it is literally setting the symbol to 1 because that's what the constant NO_SYMBOL evaluates to.