Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: how to format statistical numbers  (Read 2031 times)

0 Members and 1 Guest are viewing this topic.

jerx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85
how to format statistical numbers
« 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:
Code: [Select]
        $hit_count = (int)$nbEnr[0];with
Code: [Select]
        $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.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: how to format statistical numbers
« Reply #1 on: November 18, 2008, 12:35:52 pm »

The function number_format() is meant to be used exactly for that purpose.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: how to format statistical numbers
« Reply #2 on: November 19, 2008, 10:26:03 am »

That's why
Code: [Select]
$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
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 20 queries.