Dysan Posted November 30, 2007 Share Posted November 30, 2007 How do I output currency, as the zero on the end of the following value gets cut off: e.g. £0.50 How do I add a zero, if a zero is expected to appear at the end of the value? Link to comment https://forums.phpfreaks.com/topic/79536-currency/ Share on other sites More sharing options...
thebadbad Posted November 30, 2007 Share Posted November 30, 2007 Use the number_format function. Its second parameter specifies number of decimals, so: <?php echo number_format(0.5, 2); //will echo 0.50 ?> Link to comment https://forums.phpfreaks.com/topic/79536-currency/#findComment-402843 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.