svgmx5 Posted April 28, 2010 Share Posted April 28, 2010 Can anyone give me a hand in helping me figure out how to keep those trailing zero's? Whats happening right now is that i have a shopping cart. Its php and mysql based. Upon checking out it displays the charges...total, subtotal and shipping..however when the charge is 23.00..the zero drops..so it displays as 23, or if the charge is 32.50..it would just display as 32.5 Can anyone help me with this? What extra steps do i have to take..and so on Thanks! Link to comment https://forums.phpfreaks.com/topic/200006-trailing-zeros-keep-getting-dropped/ Share on other sites More sharing options...
anups Posted April 28, 2010 Share Posted April 28, 2010 use number_format echo number_format(32.50,2); Link to comment https://forums.phpfreaks.com/topic/200006-trailing-zeros-keep-getting-dropped/#findComment-1049742 Share on other sites More sharing options...
svgmx5 Posted April 28, 2010 Author Share Posted April 28, 2010 Awesome thanks! that did the job Link to comment https://forums.phpfreaks.com/topic/200006-trailing-zeros-keep-getting-dropped/#findComment-1049746 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.