3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $summ = 200.01; var_dump([ sprintf('%.2f', $summ), sprintf('%02.2f', $summ), sprintf('%2.2f', $summ), sprintf('%2f', $summ), sprintf('%2.2f', $summ), sprintf('%2.2f', $summ), sprintf('%2.2f', $summ), sprintf('%2.2f', $summ), sprintf('%2.2f', $summ), sprintf('%2.2f', $summ), sprintf('%2.2f', $summ), ]);
based on 7ntCe
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.1.7
array(11) { [0]=> string(6) "200.01" [1]=> string(6) "200.01" [2]=> string(6) "200.01" [3]=> string(10) "200.010000" [4]=> string(6) "200.01" [5]=> string(6) "200.01" [6]=> string(6) "200.01" [7]=> string(6) "200.01" [8]=> string(6) "200.01" [9]=> string(6) "200.01" [10]=> string(6) "200.01" }