MrAdam Posted January 19, 2007 Share Posted January 19, 2007 Hi. i have made a shopping cart and all works perfectly apart from when adding the items, the sub totals have 0's removed off the end. How do i prevent PHP from automatically removing the 0's ? Link to comment Share on other sites More sharing options...
jesh Posted January 19, 2007 Share Posted January 19, 2007 Check out number_format() (@ http://www.php.net/number_format) Link to comment Share on other sites More sharing options...
MrAdam Posted January 19, 2007 Author Share Posted January 19, 2007 thanks but that didn't help ..UPDATE: sorry, was using it wrong .. number_format($price, 2); works great thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now