Format a number with grouped thousands
<p>I have the following function:</p>

<pre><code>function getPostViews($postID){
    $count_key = 'post_views_count';
    $count = get_post_meta($postID, $count_key, true);
    if($count==''){
        delete_post_meta($postID, $count_key);
        add_post_meta($postID, $count_key, '0');
        return __('0 View','mm');
    }
    return $count. __(' Views','mm'); 
}
</code></pre>

<p>How do I make it format a number to include a comma in the thousandths place? For example, 50000 should become 50,000.</p>
