SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2008
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Number being formatted but missing dollar sign

    Hi all
    This formats the numbers as required but it doesn't show a $ sign. How can I make it show one? Thanks!

    PHP Code:
    echo '<td>'.number_format(trim($_transacciones[$i]['total_value'])).'</td>'

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Add a dollar sign to the echo statement, or take a look at http://www.php.net/money-format

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2008
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks so like this?
    echo '<td>'.number_format(trim('$',$_transacciones[$i]['total_value'])).'</td>';

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Did you try it? That shouldn't work. Try this instead:

    echo '<td>$'.number_format(trim($_transacciones[$i]['total_value'])).'</td>';


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •