#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    60
    Rep Power
    15
    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. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    31
    Rep Power
    15
    Again.. You need to use printf or number_format.

    ------------------
    ---
    Dist - dist@clan-station.org - Founding member of Clan Station

Similar Threads

  1. Mysql problem.
    By Nik in forum MySQL Help
    Replies: 54
    Last Post: December 21st, 2006, 07:02 PM
  2. MySQL to MS SQL 2000
    By diskord in forum MySQL Help
    Replies: 0
    Last Post: February 6th, 2004, 08:00 PM
  3. Starting MySQL
    By bwreath in forum MySQL Help
    Replies: 1
    Last Post: January 21st, 2004, 12:17 AM
  4. Creating a MySQL table. errno: 140
    By WorldBuilder in forum MySQL Help
    Replies: 1
    Last Post: December 18th, 2003, 03:43 PM

IMN logo majestic logo threadwatch logo seochat tools logo