You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2012-07-12 12:01:26

adrianmarsh
Member
Registered: 2006-08-28
Posts: 379

Get rid of the "," in ticket numbers

Hi,

Can we lose the "," thats been added into ticket numbers ?  In modern English, you would use commas when describing monetary items, but not when its a static number such as a ticket reference.


GLPI 0.83.91/CENTOS5 - OCS 1.01/Win2003

Offline

#2 2012-07-13 14:58:01

conte64
Member
Registered: 2012-07-13
Posts: 20

Re: Get rid of the "," in ticket numbers

Hi, it's just a workaround and it is NOT update proof but I've obtained the result you expect with this modifications:

- inc/config.class.php line ~749:
change from
      $values = array
                     (0 => '1 234.56',
                      1 => '1,234.56',
                      2 => '1 234,56');

to
      $values = array
                     (0 => '1 234.56',
                      1 => '1,234.56',
                      2 => '1 234,56',
                      3 => '1234.56');


- inc/html.class.php line ~288:
change from
      switch ($_SESSION['glpinumber_format']) {
         case 2 : // Other French
            return str_replace(' ', ' ', number_format($number, $decimal, ',', ' '));

         case 0 : // French
            return str_replace(' ', ' ', number_format($number, $decimal, '.', ' '));

         default: // English
            return number_format($number, $decimal, '.', ',');
      }

to

      switch ($_SESSION['glpinumber_format']) {
         case 2 : // Other French
            return str_replace(' ', ' ', number_format($number, $decimal, ',', ' '));

         case 0 : // French
            return str_replace(' ', ' ', number_format($number, $decimal, '.', ''));

         case 3 :
            return str_replace(' ', ' ', number_format($number, $decimal, ',', ''));

         default: // English
            return number_format($number, $decimal, '.', ',');
      }

It works with glpi 0.83.2 and with 0.83.31 (tested today)

It would be great to have the option to format numbers this way implemented by default

Offline

#3 2012-07-17 19:10:29

adrianmarsh
Member
Registered: 2006-08-28
Posts: 379

Re: Get rid of the "," in ticket numbers

Hi conte64,

thanks for that - I'd really like it to be put in as a bug/update though, rather than a hack.  Its not consistant either, there are parts of GLPI that still reference the old way without commas. I don't know why they changed it.


GLPI 0.83.91/CENTOS5 - OCS 1.01/Win2003

Offline

#4 2012-07-20 09:25:12

conte64
Member
Registered: 2012-07-13
Posts: 20

Re: Get rid of the "," in ticket numbers

You are right. But I had to fix this now so I written those lines of code. Hope it will be fixed permanently in next releases.
Regards.

Offline

Board footer

Powered by FluxBB