PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
to round to the nearest two decimal places, but when it's a whole number, it doesn't echo any decimal places. I would like it to display ".00" if its a whole number. How can I do that?
Last edited by DudeBori82 on Thu Dec 09, 2004 4:15 pm, edited 1 time in total.
If you're getting a ' or " with '' or \" then use [php_man]stripslashes[/php_man](). For getting decimal places, try [php_man]sprintf[/php_man]() or [php_man]number_format[/php_man]()
You COULD put it inside echo() but it's harder to see whats going on. Just execute the function on the variable to create a new variable $roundedUp or something, then echo that variable back out