1000 to 1,000

Discuss features as they are added to the new version. Give us your feedback. Don't post bug reports, feature requests, support questions or suggestions here.
Forum rules
Discuss features as they are added to the new version. Give us your feedback. Don't post bug reports, feature requests, support questions or suggestions here. Feature requests are closed.
markus_petrux
Registered User
Posts: 376
Joined: Fri Jun 18, 2004 10:58 pm
Location: Girona, Catalunya (Spain)
Contact:

Re: 1000 to 1,000

Post by markus_petrux » Thu Dec 29, 2005 10:51 am

:)

Here's a function I wrote some time ago for the purpose (a portal I was writting).

Code: Select all

/**
 * Wrapper for the PHP function number_format.
 *
 * Note thousands separator and decimal point are language dependent.
 *
 * @access public
 * @param float The number.
 * @param integer Number of decimals.
 * @return string The formatted number.
 */
function phpbb_number_format($number, $decimals = 0)
{
	global $lang;
	return number_format($number, $decimals, $lang['Number_decimal_point'], $lang['Number_thousands_sep']);
}

winsrev
Registered User
Posts: 15
Joined: Sat May 07, 2005 8:45 pm

Re: 1000 to 1,000

Post by winsrev » Thu Dec 29, 2005 12:48 pm

Okay, do it in the language file then :D
My search engine: http://winsrev.com

warmweer
Registered User
Posts: 108
Joined: Wed Jul 09, 2003 5:27 pm
Location: Belgium

Re: 1000 to 1,000

Post by warmweer » Fri Dec 30, 2005 9:44 am

dhn wrote:
markus_petrux wrote: It could probably be defined in the language files, if its country dependency can be assumed from the language, otherwise it could be added to the user profile so they can choose it like they do with date format, time zone, etc.
Quoted for agreement. Language file would be the only sensible way.
Point taken and when it comes to numbers displayed in phpBB features I see no reason to differ in opinion. However, I kind of had the impression that the topic starter implied formatting all numbers in posts, and this is (IMHO) totally useless and could cause confusion.
Procrastination is my hobby, but I keep on postponing it.

User avatar
smithy_dll
Registered User
Posts: 461
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Contact:

Re: 1000 to 1,000

Post by smithy_dll » Fri Jan 06, 2006 10:39 am

In windows it's set by locality (you can change to any character you want), as it should be in phpBB.

As for what IPB does, thats them, this is phpBB.
Image
phpBB, its open source, become involved, write a modification!
Modifications Database | MOD Development Forum Rules | MOD Studio

uranusalien
Registered User
Posts: 32
Joined: Mon Oct 27, 2003 4:48 pm
Contact:

Re: 1000 to 1,000

Post by uranusalien » Wed Jan 11, 2006 4:58 pm

warmweer wrote:
dhn wrote:
markus_petrux wrote: It could probably be defined in the language files, if its country dependency can be assumed from the language, otherwise it could be added to the user profile so they can choose it like they do with date format, time zone, etc.
Quoted for agreement. Language file would be the only sensible way.
Point taken and when it comes to numbers displayed in phpBB features I see no reason to differ in opinion. However, I kind of had the impression that the topic starter implied formatting all numbers in posts, and this is (IMHO) totally useless and could cause confusion.
No, I think he was referring to the formatting of statistics like number of topics in a forum.

I agree with using the language file - using a space would work, but there may be situations where a board is oriented heavily toward a specific locale. For example in the UK, commas are used.

Limit-Studios
Registered User
Posts: 11
Joined: Sun Jun 06, 2004 3:56 pm

Re: 1000 to 1,000

Post by Limit-Studios » Wed Jan 11, 2006 7:32 pm

thanxs for the code markus_petrux, i've added to my language files and have it working on my 2.0.19 forum.

markus_petrux
Registered User
Posts: 376
Joined: Fri Jun 18, 2004 10:58 pm
Location: Girona, Catalunya (Spain)
Contact:

Re: 1000 to 1,000

Post by markus_petrux » Wed Jan 11, 2006 9:04 pm

Sweet.

/me curious, what kind of numbers do you apply it?

Limit-Studios
Registered User
Posts: 11
Joined: Sun Jun 06, 2004 3:56 pm

Re: 1000 to 1,000

Post by Limit-Studios » Wed Jan 11, 2006 9:20 pm

the topics and post on the index and viewforum, and the members posts in viewtopic.

I hope thats what you meant. Thats all i have at the moment but i'm hopefully gonna have full formatting by the weekend on things such as total posts and total members but i have to add 1000+ test members to my test development server.

markus_petrux
Registered User
Posts: 376
Joined: Fri Jun 18, 2004 10:58 pm
Location: Girona, Catalunya (Spain)
Contact:

Re: 1000 to 1,000

Post by markus_petrux » Wed Jan 11, 2006 9:46 pm

Yes, that's what I meant. Thanks ;)

Limit-Studios
Registered User
Posts: 11
Joined: Sun Jun 06, 2004 3:56 pm

Re: 1000 to 1,000

Post by Limit-Studios » Wed Jan 11, 2006 9:54 pm

the only thing i had to do was make a few changes using some of a MOD on another website. So it would parse properly and wouldn't stop after the ,

I now have it in my CVS of phpBB3 with a few changes here and there just for testing so i can use it on my phpBB3 forum when it's available.

Also i'm wondering is this likely to affect performance.

Post Reply