coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: jerx on November 17, 2008, 04:40:35 PM

Title: how to format statistical numbers
Post by: jerx on November 17, 2008, 04:40:35 PM
I wanted to format the numbers of the statistics, because they were hard to read especially the number of views.

I modified index.php as follows:
In line 302 (in the gather gallery statistics section)
replace:
        $hit_count = (int)$nbEnr[0];
with
        $hit_count = number_format((int)$nbEnr[0],0,',','.');

Here are the official php instructions:
http://php.net/manual/en/function.number-format.php

I am not a coder and I don' t know if this is correct, but it works for me. Maybe there is an easier or better way to do this. It would be great, if a coder can check this.
Title: Re: how to format statistical numbers
Post by: Stramm on November 18, 2008, 12:35:52 PM
The function number_format() is meant to be used exactly for that purpose.
Title: Re: how to format statistical numbers
Post by: Joachim Müller on November 19, 2008, 10:26:03 AM
That's why $lang_decimal_separator = array(',', '.');  //cpg1.5 // symbol used to separate thousands from hundreds and rounded number from  decimal placehas been introduced in the lang files for cpg1.5.x