File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
standard /
tests /
strings /
sprintf_f_3.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:04 2012 UTC (12 years, 5 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
sprintf %f #3
--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--
string(7) "100,426"
string(6) "100,43"
string(11) "100,426000'"
string(6) "123,10"
string(8) "1.231e+2"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>