Post by leportos » Thu Jan 17, 2008 2:46 am

Hi every body,

Short question:
When i enter a price like : 2,34, the program change it to 2,00.

I didn't find the solution yet, not even in the forum.

If you can help i apreciate.

Thanks from Portugal

Leportos

Newbie

Posts

Joined
Thu Jan 17, 2008 2:42 am

Post by JohnnyO » Thu Jan 17, 2008 4:56 am

Open cart uses the period "." for a decimal point. Portugal and other locals use the comma ","

I don't think there is any way around this at the moment and unfortunately it would probably involve a LOT of work to change this. 

If you make it idiot proof, they will just build a better idiot.


User avatar
New member

Posts

Joined
Wed Nov 14, 2007 7:31 am
Location - Denver, CO - USA

Post by leportos » Thu Jan 17, 2008 6:21 pm

Thanks for the fast answer,



In fact, i thought the problem was a SQL configuration in Decimal.
I changed, in SQL-Product-decimal the value of 15,4 for 15,2, that correspond to the configuration of Opencart, and it works.

If a fact has to do with the other, i don't know:)..As i told you i'm a novice, i just try ot understand.

The fact is my prices appear now as 2,35 and not as previously 2,00.

Thanks again

Leportos

Newbie

Posts

Joined
Thu Jan 17, 2008 2:42 am

Post by leportos » Sat Jan 19, 2008 1:46 am

Hi,

You were right!!!  I have to use the "." instead of",".

The funny part is: opencart doesn't accept the "," the first time but accept it the second time:)

Thanks again.

Leportos

Newbie

Posts

Joined
Thu Jan 17, 2008 2:42 am

Post by david.gilbert » Mon Jan 21, 2008 6:06 pm

in the file library/cart/currency.php find the following (line 77 in my opencart version 0.7.7 -> php5)

Code: Select all

	$string .= number_format(round($value, $decimal_place), $decimal_place, (($format) ? $this->language->get('decimal_point') : '.'), (($format) ? $this->language->get('thousand_point') : NULL));
and replace with

Code: Select all

	$string .= number_format(round($value, $decimal_place), $decimal_place, (($format) ? $this->language->get('decimal_point') : ','), (($format) ? $this->language->get('thousand_point') : NULL));
I cant remember what the euro thousand point is, but the thousand point can be changed by changing

$string .= number_format(round($value, $decimal_place), $decimal_place, (($format) ? $this->language->get('decimal_point') : '.'), (($format) ? $this->language->get('thousand_point') : NULL));

to


$string .= number_format(round($value, $decimal_place), $decimal_place, (($format) ? $this->language->get('decimal_point') : '.'), (($format) ? $this->language->get('thousand_point') : '.'));

-Dave

Professional Website Services - http://www.davidmgilbert.com/


User avatar
Active Member

Posts

Joined
Sun Jan 06, 2008 5:02 pm
Location - Mount Compass, South Australia

Post by david.gilbert » Mon Jan 21, 2008 7:00 pm

See here http://forum.opencart.com/index.php/topic,857.0.html

I decided to do it properly lol, now you can specify the decimal and thousands seperators in admin and per currency! great for when you sell in both US DOLLARS and EUROS

-Dave

Professional Website Services - http://www.davidmgilbert.com/


User avatar
Active Member

Posts

Joined
Sun Jan 06, 2008 5:02 pm
Location - Mount Compass, South Australia
Who is online

Users browsing this forum: No registered users and 0 guests