PHP-Web-Stat Support Forum
https://www.php-web-statistik.de/cgi-bin/yabb/YaBB.pl
Board (English) >> English board >> Can I change the number delimiter for English ?
https://www.php-web-statistik.de/cgi-bin/yabb/YaBB.pl?num=1705068145

Beitrag begonnen von John Motyer am 12.01.24 um 15:02:25

Titel: Can I change the number delimiter for English ?
Beitrag von John Motyer am 12.01.24 um 15:02:25
Hello again, Reimar & Holger,

Is there an easy & simple place in a single file that I can change your code, so that my WebStat websites (which display in English) can have their number delimiter use a comma separator (that the English language uses), instead of the current decimal delimiter (that the German language uses & which WebStat currently uses for English also)?

Example...

Currently:  123.456 (for both German & English)
English:  123,456

Thank you in advance.

Regards,
John

Titel: Re: Can I change the number delimiter for English ?
Beitrag von Reimar am 12.01.24 um 21:20:02
Hi John,

good point ! We will keep this in mind for our next update.

If you want to try for yourself, have a look at the func/func_display.php as an example and search for the function 'number_format'.

Our code

Code (php):
number_format ( $module2 , 0 , "," , "." )


New code

Code (php):
number_format ( $module2)


There are several variables ($module2, etc.) that need to be changed. Our example you will find at lines 70ff.

Best regards
Reimar


Titel: Re: Can I change the number delimiter for English ?
Beitrag von John Motyer am 12.01.24 um 22:07:04
Perfect.  Code modifications made, and my sites now display the comma delimeter.

I also modified lines 364 and 365, by inserting spaces on both sides of the slash: from '/'  to  ' / ', to make those easier to read on their respective pages.

I haven't looked yet to see if it is possible to change the delimeters similarly for Last Hits... will maybe search for that code this weekend, but changing the delimeter for Last Hits is NOT important to me.

Thank you for your quick reply, and have a great weekend.

Regards,
John

Titel: Re: Can I change the number delimiter for English ?
Beitrag von Reimar am 05.11.24 um 20:38:00
Hi John,

the next update will give you the setting to use a self defined character as a separator.

Thx
Reimar

PHP-Web-Stat Support Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2012. Alle Rechte vorbehalten.