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? Quote Link to comment 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 ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.