Return to bug25694.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / math |
1.1 misho 1: --TEST-- 2: Bug #25694 (round() and number_format() inconsistency) 3: --INI-- 4: precision=14 5: --FILE-- 6: <?php 7: echo "round 0.045 = " . round(0.045, 2) . "\n"; 8: echo "number format 0.045 = " . number_format(0.045, 2) . "\n\n"; 9: echo "round 0.055 = " . round(0.055, 2) . "\n"; 10: echo "number format 0.055 = " . number_format(0.055, 2) . "\n\n"; 11: echo "round 5.045 = " . round(5.045, 2) . "\n"; 12: echo "number format 5.045 = " . number_format(5.045, 2) . "\n\n"; 13: echo "round 5.055 = " . round(5.055, 2) . "\n"; 14: echo "number format 5.055 = " . number_format(5.055, 2) . "\n\n"; 15: echo "round 3.025 = " . round(3.025, 2) . "\n"; 16: echo "number format 3.025 = " . number_format(3.025, 2) . "\n\n"; 17: echo "round 4.025 = " . round(4.025, 2) . "\n"; 18: echo "number format 4.025 = " . number_format(4.025, 2) . "\n\n"; 19: ?> 20: --EXPECT-- 21: round 0.045 = 0.05 22: number format 0.045 = 0.05 23: 24: round 0.055 = 0.06 25: number format 0.055 = 0.06 26: 27: round 5.045 = 5.05 28: number format 5.045 = 5.05 29: 30: round 5.055 = 5.06 31: number format 5.055 = 5.06 32: 33: round 3.025 = 3.03 34: number format 3.025 = 3.03 35: 36: round 4.025 = 4.03 37: number format 4.025 = 4.03