-
php trim price
I am trying to create an allposters site after reading the review.
Well everything is coming along fine until I went to print the price out. It seems they use a four digit decimal for some reason. Example: $32.0000
Well I looked at php.net under the trim function but couldn't find anything on how to trim from the end. Does anyone have any ideas on how to do this?
-
If you're inserting into a DB you could set the mysql field parameters to use just 2 decimals.
-
and if you're not,
$price = round($price, 2);
trim is used to eliminate whitespace at the end of a string
-
Thanks guys. I am storing the info in a db but didn't think of doing it that way. Thanks a ton for both answers!