Displaying locale percentage number with Zend Framework
Posted
by Ronedog
on Stack Overflow
See other posts from Stack Overflow
or by Ronedog
Published on 2010-03-07T19:50:51Z
Indexed on
2010/03/08
10:21 UTC
Read the original article
Hit count: 736
zend-framework
|internationalization
Does anyone know how to display a percentage format based on the locale using the zend framework? I've tried this below and it doesn't work for some reason:
$xx = Zend_Locale::getTranslation(null, 'PercentNumber'); // This outputs: "#,##0%" for locale 'en_us'
$percentage = Zend_Locale_Format::getNumber(133.3678, array('number_format' => $xx, 'locale' => $lang_LOCALE));
The output of $percentage is 133.3678.
Thanks.
© Stack Overflow or respective owner