php-src/ext/standard/tests/strings/sprintf_f_3.phpt
Steph Fox 87fac43ac0 - killed off UEXPECT
- html_translation_table and setlocale tests are no longer relevant
- there are a number of ANSI-encoded files. Is this deliberate?
2008-05-27 10:50:48 +00:00

26 lines
604 B
PHP
Executable File

--TEST--
sprintf %f #3
--INI--
error_reporting=6143
--SKIPIF--
<?php if(false == setlocale(LC_NUMERIC, "is_IS", "is_IS.UTF-8")) print "skip icelandic locale not supported"; ?>
--FILE--
<?php
setlocale(LC_NUMERIC, "is_IS", "is_IS.UTF-8");
var_dump(sprintf("%.3f", 100.426));
var_dump(sprintf("%.2f", 100.426));
var_dump(sprintf("%f'", 100.426));
$money1 = 68.75;
$money2 = 54.35;
$money = $money1 + $money2;
var_dump(sprintf("%01.2f", $money));
var_dump(sprintf("%.3e", $money));
?>
--EXPECT--
unicode(7) "100,426"
unicode(6) "100,43"
unicode(11) "100,426000'"
unicode(6) "123,10"
unicode(8) "1.231e+2"