I have another stupid question, lol, if you have a number that's one decimal place how do you add a 0 after it. For example how do you determine if variable $number (say $number = 19.5 ) has one decimal place and make it add a 0 after it to make $number = 19.50. (lol, there is an actual reason for this) Though I also have the same question for the reverse, say $number = 19.539 how would I be able to make $number = 19.54?
All of those worked great, but for some reason I still have a problem when a price is $10.50 it shows it as $10.5, if it's $7.00 it shows it as $7. I need the extra zeros, how do I do this is there is only one or less digits after the decimal?
You should use the money_format() function. It's purpose is to do what you want to do. You might also look at number_format().