1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00
Files
archived-php-src/ext/standard/tests/strings/printf_h_H.phpt
Nikita Popov b6000b7e0e Add support for %h and %H in printf()
These are locale-independent variants of %g and %G.

Closes GH-5436.
2020-05-27 10:19:23 +02:00

20 lines
369 B
PHP

--TEST--
sprintf() %h and %H specifiers
--SKIPIF--
<?php
if (!setlocale(LC_ALL, "de_DE.utf8")) die("skip de_DE.utf8 locale not available");
?>
--FILE--
<?php
setlocale(LC_ALL, "de_DE.utf8");
$f = 1.25;
printf("%g %G %h %H\n", $f, $f, $f, $f);
$f = 0.00000125;
printf("%g %G %h %H\n", $f, $f, $f, $f);
?>
--EXPECT--
1,25 1,25 1.25 1.25
1,25e-6 1,25E-6 1.25e-6 1.25E-6