Page 1 of 1

Currency value problem (Interesting!)

Posted: Tue Jan 08, 2019 11:24 pm
by yamahapower

I use USD as default currency and set it to 1.0000. When i try to set other currencies TRY and EUR, something happens.

I enter 0.8662 for EUR and 5.4000 for TRY. But when i hit save and go to main currency screen, they set different values.

0.86619997 for EUR and 5.40000010. Is this normal? Where is the problem? How can i fix it?

I hang a scrren. Could you please help me about this? Thanks.


Re: Currency value problem (Interesting!)

Posted: Wed Jan 09, 2019 6:53 am
by ADD Creative
It because the database uses a "float(15,8)" to store the value, which does not have enough precision for your value. The (15,8) seems to restrict the value somehow and leads to more errors. You could try changing the database value in the oc_currency table to use "double(15,8)". This seems to be what OpenCart 3 uses. ... 8d0c454667

Even just "float" or "double" may be better.