ZF-11960: Zend_Locale_Format::toNumber() produces no percent sign when used with 'number_format' => Zend_Locale_Data::getFormat('en', 'percentnumber');


Steps to reproduce: run

    $n = 3000.1;                                                                                                                                                         
    $f = Zend_Locale_Data::getContent('en_GB', 'percentnumber');                                                                                                         
    $out = Zend_Locale_Format::toNumber($n, array('number_format' => $f, 'locale' => 'en_GB'));
    assert('false !== strpos($out, "%")');

Expected results: Assertion does not fail

Actual results:

 PHP Warning:  assert(): Assertion "false !== strpos($out, "%")" failed in ../e.php on line 6
 PHP Stack trace:
 PHP   1. {main}() ../e.php:0
 PHP   2. assert() ../e.php:5

Even though I found this issue in 1.11.8 I believe it affects later versions as well. In 1.7.9 this was working as expected.


As long as I read the implementation of Zend_Locale_Format::toNumber(), it seems to accept only format tokens.(i.e. #0,.) Assuming that it is appropriate, where should we use percent number format etc?