AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

[Solved] Thousands separator

6 Posts
3 Users
2 Reactions
1,043 Views
Posts: 3
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@malouk)
Active Member
Joined: 4 years ago
[#62477]

Hello,

Is it possible to change the thousands separator ?

By a space or a punt ?

Tanks

 Capture

5 Replies
Sofy
Posts: 5774
 Sofy
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@sofy)
Support Team
Joined: 8 years ago

Hi,

Could you please provide us with a full-page screenshot to help us better understand the issue?


Reply
Posts: 3
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@malouk)
Active Member
Joined: 4 years ago

Hello,

In the French, Belgian, and Swiss systems, the decimal separator is represented by a comma and the thousands separator by a space.

 Capture

Reply
2 Replies
Sofy
 Sofy
Admin
(@sofy)
Joined: 8 years ago

Support Team
Posts: 5774
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@malouk 

You can customize the wpForo theme files.

Please read attentively this doc:   https://wpforo.com/docs/wpforo-v2/forum-themes/theme-files/   You'll find more information about wpForo theme files here

For an update-safe way of customization, please refer to this documentation:   https://wpforo.com/docs/wpforo-v2/forum-themes/theme-customization/


Reply
(@golabs)
Joined: 5 years ago

Trusted Member
Posts: 47
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@malouk in pretty much all of Europe and many other countries around the world 🙂

So it would be great to have the choice as a wpForo setting.


Reply
Posts: 3
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@malouk)
Active Member
Joined: 4 years ago

Hello,

The problem stems from the fact that WordPress uses the PHP number_format function instead of the WordPress number_format_i18n function (in the functions.php file).

function wpforo_print_number( $n, $echo = false ) {
	$x      = str_replace( ",", "", $n );
	$x      = intval( $x );
	$n      = 0 + $x;
	$number = 0;
	if( ! is_numeric( $n ) ) return false;
	if( $n > 1000000000000 ) {
		$number = round( ( $n / 1000000000000 ), 1 ) . ' ' . str_replace( '{number}', '', wpforo_phrase( '{number}T', false ) );
	} else if( $n > 1000000000 ) {
		$number = round( ( $n / 1000000000 ), 1 ) . ' ' . str_replace( '{number}', '', wpforo_phrase( '{number}B', false ) );
	} else if( $n > 1000000 ) {
		$number = round( ( $n / 1000000 ), 1 ) . ' ' . str_replace( '{number}', '', wpforo_phrase( '{number}M', false ) );
	} else if( $n > 10000 ) $number = round( ( $n / 1000 ), 1 ) . ' ' . str_replace( '{number}', '', wpforo_phrase( '{number}K', false ) );
	
	$number = ( $number ) ? $number : number_format( $n );
	
	if( $echo ) {
		echo $number;
	} else {
		return $number;
	}
}

this should be

function wpforo_print_number( $n, $echo = false ) {
	$x      = str_replace( ",", "", $n );
	$x      = intval( $x );
	$n      = 0 + $x;
	$number = 0;
	if( ! is_numeric( $n ) ) return false;
	if( $n > 1000000000000 ) {
		$number = round( ( $n / 1000000000000 ), 1 ) . ' ' . str_replace( '{number}', '', wpforo_phrase( '{number}T', false ) );
	} else if( $n > 1000000000 ) {
		$number = round( ( $n / 1000000000 ), 1 ) . ' ' . str_replace( '{number}', '', wpforo_phrase( '{number}B', false ) );
	} else if( $n > 1000000 ) {
		$number = round( ( $n / 1000000 ), 1 ) . ' ' . str_replace( '{number}', '', wpforo_phrase( '{number}M', false ) );
	} else if( $n > 10000 ) $number = round( ( $n / 1000 ), 1 ) . ' ' . str_replace( '{number}', '', wpforo_phrase( '{number}K', false ) );
	
	$number = ( $number ) ? $number : number_format_i18n( $n );
	
	if( $echo ) {
		echo $number;
	} else {
		return $number;
	}
}

Reply
Share: