xref: /PHP-8.3/ext/intl/tests/bug53735.phpt (revision 74859783)
1--TEST--
2Bug #53735 NumberFormatter returns NaN when converting float point
3--EXTENSIONS--
4intl
5--SKIPIF--
6<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
7--FILE--
8<?php
9
10$fmt = numfmt_create("da_DK", \NumberFormatter::CURRENCY);
11
12var_dump(numfmt_format($fmt, 5.5));
13setlocale(LC_ALL, "da_DK.UTF-8");
14
15var_dump(numfmt_format($fmt, 5.5));
16
17
18$fmt = new \NumberFormatter("de_DE", \NumberFormatter::DECIMAL);
19var_dump($fmt->format(23.25));
20
21$f = new NumberFormatter('hu_HU', NumberFormatter::PERCENT, '#,##0%');
22var_dump($f->format(0.26));
23
24?>
25--EXPECTF--
26string(%d) "5,50 kr%A"
27string(%d) "5,50 kr%A"
28string(5) "23,25"
29string(3) "26%"
30