wordpress count per day plugin – display number with thousends seperator

I want to display the number of visitors by using this code:

                <p> All visitors: 
                 <?php global $count_per_day;
                 if(method_exists($count_per_day,"show"))
                 echo $count_per_day->getUserAll( $return );?><br />
                </p>

Currently it shows the number without thousend seperator.
I`ve tried “number_format($number)”, but it won’t work.

Related posts

1 comment

  1. Replace this line:

    echo $count_per_day->getUserAll( $return );?><br />
    

    With these three:

    $count_before = $count_per_day->getUserAll( $return );
    $count_after = number_format(intval($count_before), 0, null, ' ');
    echo $count_after;?><br />
    

    This will output 7000 as 7 000. If you want another separator, replace the third variable in the number_format()-function. For example '.' will output 7.000.

Comments are closed.