lmhart Posted November 5, 2009 Share Posted November 5, 2009 I am having issues echoing decimal precision. It stores in the DB just fine. Just when I go to display the data it will cut off a trailing 0. So 10.80 ends up echoing 10.8. Is there a relatively easy way to set the precision? If not I can live with it. Its just a cosmetic thing My code to display echo "Amount due - " . $total; echo "<br>"; Thanks, Mark Quote Link to comment https://forums.phpfreaks.com/topic/180443-displaying-decimal-precision/ Share on other sites More sharing options...
Psycho Posted November 5, 2009 Share Posted November 5, 2009 number_format() http://us3.php.net/manual/en/function.number-format.php Quote Link to comment https://forums.phpfreaks.com/topic/180443-displaying-decimal-precision/#findComment-951943 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.