|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Howdy,
I've got a file that gets data from MySQL. When I print the field value, I get the full number, ex: echo "$$balance"; returns "$12.00" however, when I want to add two amounts that have empty decimal values ex. ($balance=12.00; $add_fees=0.00) $total = $balance + $add_fees; echo "$$total"; then only "$12" is returned, missing the empty decimal value. but I need to print the empty decimal as ".00" this one has really stumped me. I appreciate any ideas. Aaron |
|
#2
|
|||
|
|||
|
Again.. You need to use printf or number_format.
------------------ --- Dist - dist@clan-station.org - Founding member of Clan Station |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Getting full decimal from MySQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|