Localising Percentages

1 message Options
Embed this post
Permalink
Simon Corless

Localising Percentages

Reply Threaded More More options
Print post
Permalink
Hopefully you can help I used to use the following code prior to 1.9.3 to format a percentage using the locale, now however it just seems to return the number (with precision), has anything changed or is there a better way?

I have used both getNumber and toNumber and the format being returned from getTranslation seems to be correct (#,##0%).

return Zend_Locale_Format::getNumber(15.00, array(
            'precision' => 2,
            'number_format' => $this->_locale->getTranslation(null, 'PercentNumber'),
            'locale' => $this->_locale,
        ));

Thanks for your time.
Simon