PHP - Numbers to two decimal places?
Hi,
I've made a script, it's a fruit machine. It takes away $1.00 from your account, and that it your balance. You then spin the reel. If you lose, it removes $0.20 from your balance. If you win, depending on the winning icon, you recieve $x.xx.
Now, I want the balance value to always be shown in two decimal places.. but sometimes it doesnt do this..
For example, when it is on $0.00, it shows up as: $00
Also, when it should be $15.00 it shows up as $150
All other times it shows up normally like $13.20 and $8.70
How do I make it so the numbers always go to 2 decimal places?
Cheers, Cheeko