View Issue Details

IDProjectCategoryView StatusLast Update
0005292OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2013-07-16 11:37
Reportervschmi 
PriorityhighSeveritycriticalReproducibilitysometimes
Status resolvedResolutionduplicate 
Product Version4.7.6 / 5.0.6 
Target VersionFixed in Version 
Summary0005292: OXID uses double for monetary values, leading to problems all over the shop
DescriptionHi,

as outlined in issue 0005291, OXID uses double. However, I didn't realize that OXID uses double values all over the place. This leads to rounding problems, especially with MySQL 5.5.

DOUBLE is _APPROXIMATE VALUES_, which means that rounding errors will occur. This is expected and not a bug in MySQL, this is just how floating point values work.

Read more about this:
http://dev.mysql.com/doc/refman/5.0/en/floating-point-types.html
http://en.wikipedia.org/wiki/Floating_point

In other words: Expressing monetary values like prices or other things like order amounts in double is _wrong_ and _will_ lead to problems. Please fix this ASAP!
Steps To ReproduceOn MySQL 5.5:

CREATE TABLE IF NOT EXISTS `test` (
  `test` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `test` (`test`) VALUES
(0.4),
(1),
(0.2),
(0.5),
(1.65),
(0.5),
(0.4),
(1),
(0.45);

SELECT SUM(test) FROM `test` WHERE 1

The SQL above gives 6.1000000000000005.
TagsNo tags attached.
ThemeBoth
BrowserAll
PHP Versionany
MySQL Versionany

Relationships

has duplicate 0005291 acknowledged Order Overview shows too many decimal fractions for order amounts 

Activities

There are no notes attached to this issue.