Forum Moderators: coopster

Message Too Old, No Replies

0's don't display

         

ron1967

3:39 am on Sep 24, 2004 (gmt 0)



I have a script that uses "echo" to display the value of a varible in a web browser, something like

echo ("<p>Total : $ $cost</p>");

where the value for $cost is 5.00. When the varible is shown in a browser, the "." and the "0"'s are not there. What am I doing wrong?

moltar

3:52 am on Sep 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WW ron1967,

money_format [ca.php.net] or printf [ca.php.net] do exactly what you want.