3v4l.org

run code in 300+ PHP versions simultaneously
<?php $total = 38.500000; $newTotal = number_format($total,2); echo $newTotal . "\n"; echo sprintf("%01.2f", $newTotal); echo sprintf("%d", $newTotal);

preferences:
63.53 ms | 402 KiB | 5 Q