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

    Join Date
    Feb 2000
    Posts
    33
    Rep Power
    15
    a simple question, i hope, but i can't find
    a solution

    i pull out of a table a price which is for
    instance $125.00 then i want to multiple
    it by 2
    $price=125.00
    $total = ($price*2);
    echo $total;

    and the output is 250
    how can i convert this to 250.00 ????

    thanks for helping me out !!

    Jan the Netherlands.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    31
    Rep Power
    15
    Try print number_format($total, 2,".",""); // Number, Decimals, Decimal separator, Thousands separator

    or printf( "%.2f", $total );

    [This message has been edited by the Blind Bastard :]

    [This message has been edited by Dist (edited April 18, 2000).]
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    33
    Rep Power
    15
    THANKS Dist !!

    the printf("%.2f",$total );
    works great :-))

    Jan.

IMN logo majestic logo threadwatch logo seochat tools logo