Source Code:
(back to article)
<?php $number = 123.456; $formattedNumber = sprintf("%.2f", $number); echo $formattedNumber; // Outputs 123.46
Result:
Report an issue