number_format()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #16
    Originally posted by Dormilich
    the point there is: with the commas, you dont need to do the string concatenation thus saving time an output (the Zero bytes). see PHP Performance
    because PHP allows for function style arguments in echo() - only echo, though. Not print().

    Good night.

    - Mark.

    Comment

    • devsusen
      New Member
      • Feb 2007
      • 136

      #17
      Originally posted by Dormilich
      the point there is: with the commas, you dont need to do the string concatenation thus saving time an output (the Zero bytes). see PHP Performance
      Oh lovely options. I must put this into my codeing habits. Thank for the information. :)

      Comment

      • sksmith
        New Member
        • Mar 2009
        • 1

        #18
        The number_format() function formats a number with grouped thousands.
        Example
        <?php
        echo number_format(" 1000000");
        echo "<br />";
        echo number_format(" 1000000",2);
        echo "<br />";
        echo number_format(" 1000000",2,",", ".");
        ?>

        you can find more easy solution here
        <url removed: no advertising please>
        thanks

        Comment

        Working...