diff options
author | Anatol Belski <ab@php.net> | 2016-06-06 21:07:45 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-06-06 21:07:45 +0200 |
commit | edb8c3f6e3abc4d5604300abde58f01e1bc8f16a (patch) | |
tree | c3c48ad69419a070c7d8b5f323ab5a6b9318e98f | |
parent | 3e6c02b91a62e3fd640dfa199f8e4178a6680821 (diff) | |
parent | 2a0ed8a2eb091e309bf2cd1560a39ea66b094e07 (diff) | |
download | php-git-edb8c3f6e3abc4d5604300abde58f01e1bc8f16a.tar.gz |
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
Add test for bug #53735
-rw-r--r-- | ext/intl/tests/bug53735.phpt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ext/intl/tests/bug53735.phpt b/ext/intl/tests/bug53735.phpt new file mode 100644 index 0000000000..5fc14e978c --- /dev/null +++ b/ext/intl/tests/bug53735.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug #53735 NumberFormatter returns NaN when converting float point +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?> +--FILE-- +<?php + +$fmt = numfmt_create("da_DK", \NumberFormatter::CURRENCY); + +var_dump(numfmt_format($fmt, 5.5)); +setlocale(LC_ALL, "da_DK.UTF-8"); + +var_dump(numfmt_format($fmt, 5.5)); +var_dump(numfmt_format($fmt, "5,5")); + + +$fmt = new \NumberFormatter("de_DE", \NumberFormatter::DECIMAL); +var_dump($fmt->format(23.25)); + +$f = new NumberFormatter('hu_HU', NumberFormatter::PERCENT, '#,##0%'); +var_dump($f->format(0.26)); + +?> +==DONE== +--EXPECTF-- +string(%d) "5,50 kr%A" +string(%d) "5,50 kr%A" +string(%d) "5,00 kr%A" +string(5) "23,25" +string(3) "26%" +==DONE== |