Annotation of embedaddon/php/ext/standard/tests/strings/sprintf_f.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: sprintf %f
3: --FILE--
4: <?php
5:
6: var_dump(sprintf("%3.2f", 1.2));
7: var_dump(sprintf("%-3.2f", 1.2));
8: var_dump(sprintf("%03.2f", 1.2));
9: var_dump(sprintf("%-03.2f", 1.2));
10: echo "\n";
11: var_dump(sprintf("%5.2f", 3.4));
12: var_dump(sprintf("%-5.2f", 3.4));
13: var_dump(sprintf("%05.2f", 3.4));
14: var_dump(sprintf("%-05.2f", 3.4));
15: echo "\n";
16: var_dump(sprintf("%7.2f", -5.6));
17: var_dump(sprintf("%-7.2f", -5.6));
18: var_dump(sprintf("%07.2f", -5.6));
19: var_dump(sprintf("%-07.2f", -5.6));
20: echo "\n";
21: var_dump(sprintf("%3.4f", 1.2345678e99));
22:
23: ?>
24: --EXPECTF--
25: string(4) "1.20"
26: string(4) "1.20"
27: string(4) "1.20"
28: string(4) "1.20"
29:
30: string(5) " 3.40"
31: string(5) "3.40 "
32: string(5) "03.40"
33: string(5) "3.400"
34:
35: string(7) " -5.60"
36: string(7) "-5.60 "
37: string(7) "-005.60"
38: string(7) "-5.6000"
39:
40: string(105) "1234567%d.0000"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>