- Add new test

This commit is contained in:
Marcus Boerger 2004-05-16 14:48:45 +00:00
parent fbd3e0da40
commit ed5ce047db

View File

@ -0,0 +1,40 @@
--TEST--
sprintf %f
--FILE--
<?php
var_dump(sprintf("%3.2f", 1.2));
var_dump(sprintf("%-3.2f", 1.2));
var_dump(sprintf("%03.2f", 1.2));
var_dump(sprintf("%-03.2f", 1.2));
echo "\n";
var_dump(sprintf("%5.2f", 3.4));
var_dump(sprintf("%-5.2f", 3.4));
var_dump(sprintf("%05.2f", 3.4));
var_dump(sprintf("%-05.2f", 3.4));
echo "\n";
var_dump(sprintf("%7.2f", -5.6));
var_dump(sprintf("%-7.2f", -5.6));
var_dump(sprintf("%07.2f", -5.6));
var_dump(sprintf("%-07.2f", -5.6));
echo "\n";
var_dump(sprintf("%3.4f", 1.2345678e99));
?>
--EXPECTF--
string(4) "1.20"
string(4) "1.20"
string(4) "1.20"
string(4) "1.20"
string(5) " 3.40"
string(5) "3.40 "
string(5) "03.40"
string(5) "3.400"
string(7) " -5.60"
string(7) "-5.60 "
string(7) "-005.60"
string(7) "-5.6000"
string(105) "12345678%d00000000000000000000000000000000000000000000000000.0000"