From f6e7b610a3ecb7becb4451c86786ba325cd62802 Mon Sep 17 00:00:00 2001 From: Cristian Quiroz Date: Wed, 20 Feb 2013 10:23:02 +0000 Subject: [PATCH] Update app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php Recently had an issue where the price of a product had 3 decimal points on the DB, 10.245 for example, but showed the rounded to 2 decimals price (10.25) on the admin panel product edit page. When hitting save for that product from the admin panel, it would save the escaped value with 2 decimal points, replacing 10.245 with 10.25, which is completely undesirable and results in all kind of funny prices after taxes are applied. Possible fixes: (1) Allow more decimal points. 4 seems reasonable, but the issue might persist. (2) Simply return $value as it comes from the database, since the method already checks that is a numeric value. Note: the other reason why the number_format was being done is to remove the thousand comma separator, but is_numeric(1,230) is false, so price data coming from the DB with comma thousand separators won't be valid anyway. --- .../Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php index 21ea6c44a980e..9ac0f28aab856 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php @@ -83,7 +83,7 @@ public function getEscapedValue($index=null) return null; } - return number_format($value, 2, null, ''); + return $value; } }