-5

Possible Duplicate:
how to reformat a number with commas
Formatting numbers with thousands separator Smarty PHP
Format a number with grouped thousands

For example the following code:-

{php}echo $youtube->_views;{/php}

returns 2556789 and I want it formatted like this; 2,556,789

Cœur
  • 37,241
  • 25
  • 195
  • 267
Luc M
  • 11
  • 5
  • [number_format()](http://php.net/manual/en/function.number-format.php) an obviously named function :-) –  Oct 28 '12 at 18:55
  • 1
    you've asked this aview hours ago! – bukart Oct 28 '12 at 18:59
  • Wasn't your previous question already closed? Please don't duplicate your questions if they are closed for good reason. – PeeHaa Oct 28 '12 at 19:01
  • 1
    Make sure you don't make the same mistake as [this guy](http://stackoverflow.com/questions/13111969/issue-with-number-format-multiply-numbers-with-comma-formatted) – vascowhite Oct 28 '12 at 19:09

1 Answers1

2

This topic says how to do it:

{$myvar|number_format:2:".":","}
Waleed Khan
  • 11,426
  • 6
  • 39
  • 70