title: Using number_format to add thousand separator
body: <p>I'm trying to quite simply take the number that is inside the variable $output and turn it into a number with a thousand separator.  The number it current outputs is 49995 but I want it to appear as 49,995.</p>
  
  <p>Having some trouble.  Help?</p>
  
  <pre><code>function twitter_followers($user = 'mytwitterusername'){
      // Build Twitter api url
      $apiurl = "http://api.twitter.com/1/users/show.json?screen_name={$user}";
  
      //cache request
      $transient_key = $user . "_twitter_followers";
  
      // If cached (transient) data are used, output an HTML
      // comment indicating such
      $cached = get_transient( $transient_key );
  
      if ( false !== $cached ) {
          return $cached;
      }
  
      // Request the API data, using the constructed URL
      $remote = wp_remote_get( esc_url( $apiurl ) );
  
      // If the API data request results in an error, return
      // an appropriate comment
      if ( is_wp_error( $remote ) ) {
          return '&lt;p&gt;Twitter unaviable&lt;/p&gt;';
      }
  
      // If the API returns a server error in response, output
      // an error message indicating the server response.
      if ( '200' != $remote['response']['code'] ) {
          return '&lt;p&gt;Twitter responded with an HTTP status code of '. esc_html( $remote['response']['code']) . '&lt;/p&gt;';
      }
  
      // If the API returns a valid response, the data will be
      // json-encoded; so decode it.
      $data = json_decode( $remote['body'] );
  
      $output = $data-&gt;followers_count;
      $followers = number_format($output,2,'.',',');
  
      set_transient( $transient_key, $output, 600 );
  
      return $followers;
  }
  </code></pre>