3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //£0.00230 -> £0.0023 and £1.50000 -> £1.50 $str = "£0.00230"; $str2 = "£1.50000"; echo number_format($str,2); echo number_format($str2,2);
based on AodB2
Output for 7.0.0 - 7.2.0
Warning: number_format() expects parameter 1 to be float, string given in /in/YR35Z on line 8 Warning: number_format() expects parameter 1 to be float, string given in /in/YR35Z on line 9
Output for 5.3.21 - 5.6.28
Warning: number_format() expects parameter 1 to be double, string given in /in/YR35Z on line 8 Warning: number_format() expects parameter 1 to be double, string given in /in/YR35Z on line 9