Post by cheeseus » Sun May 17, 2015 6:58 pm

This is a problem that hasn't been resolved in many CMS platforms, and will require additional coding.
Here is a description:

In English, where the number is larger than 999, the 'thousand separator' ('thousand point') delimiter is introduced, so that in larger numbers, the digits will be separated in groups of three, e.g. 5,000 and 340,000.

In Bulgarian, however, the thousand separator (a space) is only used for numbers larger than 9999. Numbers between 1000 and 9999 are correctly spelt without a separator, and it is only used for numbers larger than that, e.g. 10 000, 25 500, 500 000.

This results in prices or other units being incorrectly displayed, e.g. the price of a product that costs one thousand two hundred and fifty BGN will be displayed as '1 250', instead of the correct '1250'.

Without being too sure about this, I think the same rule applies to Russian, and possibly to other Slavonic languages.
Last edited by cheeseus on Sun May 17, 2015 7:12 pm, edited 2 times in total.

New member

Posts

Joined
Sat Apr 18, 2015 3:59 am

Post by OSWorX » Sun May 17, 2015 7:06 pm

Easy to fix.
Just edit the main language file (which maybe in Bulgarian bg_BG) and adopt the value

Code: Select all

$_['thousand_point']        = '.';
to

Code: Select all

$_['thousand_point']        = ' ';

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by cheeseus » Sun May 17, 2015 7:10 pm

Please read my original post again.
It is not about what the 'thousand point' is, it is about WHERE it should be inserted.

New member

Posts

Joined
Sat Apr 18, 2015 3:59 am

Post by OSWorX » Sun May 17, 2015 7:28 pm

cheeseus wrote:Please read my original post again.
It is not about what the 'thousand point' is, it is about WHERE it should be inserted.
Sorry, but what do you expect now from us?
To change to the code for Bulgarian numbers?

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by cheeseus » Sun May 17, 2015 7:50 pm

OSWorX wrote:
cheeseus wrote:Please read my original post again.
It is not about what the 'thousand point' is, it is about WHERE it should be inserted.
Sorry, but what do you expect now from us?
To change to the code for Bulgarian numbers?
As I said, I think the same rule applies for Russian and other Slavonic languages as well.
I have now checked with a colleague Russian linguist and he has confirmed the same rule applies. I am not sure about other languages that use the Cyrillic script, but it is very likely that the rule applies there, too.
So the answer is "yes" -- but not just for Bulgarian, obviously -- for Russian as well.

New member

Posts

Joined
Sat Apr 18, 2015 3:59 am

Post by OSWorX » Sun May 17, 2015 8:05 pm

As a 'starting' point.

Open

Code: Select all

../system/library/corrency.php
search for

Code: Select all

$string .= number_format(round($value, 
and add before

Code: Select all

if( $value < 9999 ) {
	$thousand_point = '';
}
And of course do a check for the language, otherwise this would be valid for all languages:

Code: Select all

if( $this->config->get( 'config_language' ) == 'bg' ) { ... }

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by cheeseus » Sun May 17, 2015 8:07 pm

Great, thank you!

This was fairly easy to implement. Just added, as per your instructions, the following code:

Code: Select all

if ($this->config->get('config_language') == 'bg') {
	if ($value < 9999) {
		$thousand_point = '';
	} 
}
and the numbers now show correctly.

New member

Posts

Joined
Sat Apr 18, 2015 3:59 am
Who is online

Users browsing this forum: No registered users and 4 guests