Page 1 of 1
Price decimal. 2,35 appear like 2,00. Help
Posted: Thu Jan 17, 2008 2:46 am
by leportos
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
Re: Price decimal. 2,35 appear like 2,00. Help
Posted: Thu Jan 17, 2008 4:56 am
by JohnnyO
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.
Re: Price decimal. 2,35 appear like 2,00. Help
Posted: Thu Jan 17, 2008 6:21 pm
by leportos
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
Re: Price decimal. 2,35 appear like 2,00. Help
Posted: Sat Jan 19, 2008 1:46 am
by leportos
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
Re: Price decimal. 2,35 appear like 2,00. Help
Posted: Mon Jan 21, 2008 6:06 pm
by david.gilbert
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
Re: Price decimal. 2,35 appear like 2,00. Help
Posted: Mon Jan 21, 2008 7:00 pm
by david.gilbert
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