SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Oct 2011
    Posts
    658
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    number_format inside <input type = "text">

    Hi..

    I used this code for displaying formatted number and I notice that instead comma(,) it become point(.):

    Code:
    $P28_maxdoz = $row['P28_maxdoz'];  
    $P28_maxdoz = number_format($P28_maxdoz, 2, '.', ',');
    
    
    <table>
    <tr>
    <td><input type='text' name='P28_maxdoz' value="<?php echo $P28_maxdoz;?>"></td>
    </tr>
    </table>
    the output is : 22.782.20

    i need output is : 22,782.20

    Thank you

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    72 Post(s)
    Tagged
    0 Thread(s)
    And do you make modifications to the variable anywhere else? Your code above obviously isnt complete.
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.


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
  •