title: PHP number_format not working properly
body: <p>i have this variable: </p>
  
  <pre><code>$out .= $indent . sprintf("{$total_space}%-{$column_total}s{$space}%{$price_width}s$newline", ___('Tax'), Am_Currency::render($this-&gt;{$prefix . '_tax'}, $this-&gt;currency));
  </code></pre>
  
  <p>Which for the time being equals 4000. I need it to be formatted like this: 4,000 so i changed my code as below:</p>
  
  <pre><code>$out .= $indent . sprintf("{$total_space}%-{$column_total}s{$space}%{$price_width}s$newline", ___('Tax'), Am_Currency::render(number_format($this-&gt;{$prefix . '_tax'}), $this-&gt;currency));
  </code></pre>
  
  <p>However, i dont know why but i get 4 instead. What happened to the other zeros? I tried with different values such as 1214.92 for example and in all cases the output leaves out the last 3 digits. </p>
  
  <p>This is the render function:</p>
  
  <pre><code>static function render($value, $currency = null, $locale = null)
      {
          return (string)self::create($value, $currency, $locale);
      } 
  
   public function __toString()
      {
          $format = array_key_exists($this-&gt;currency, $this-&gt;formats) ? 
              $this-&gt;formats[$this-&gt;currency] :
              '%.2f %s';
          return sprintf($format, $this-&gt;value, $this-&gt;currency);
      }
  </code></pre>
  
  <p>I even tried by changing the code above like this:</p>
  
  <pre><code>        return sprintf($format, number_format($this-&gt;value), $this-&gt;currency);
  </code></pre>
  
  <p>But it didnt work either. Can you please tell me whats wrong? This is blowing my mind!</p>
  
  <p>Thank you.</p>