From 9d24a5570ae3958067edbe8c93ed3af6232920d7 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 15 Sep 2003 18:36:03 +0000 Subject: [PATCH] =?UTF-8?q?On=20arrondit=20le=20prix=20=E0=202=20digits=20?= =?UTF-8?q?tant=20que=20l'on=20ne=20g=E8re=20que=202=20digits=20dans=20le?= =?UTF-8?q?=20reste=20de=20l'appli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/product.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/product.class.php b/htdocs/product.class.php index d1dfd73cd44..815c21f509a 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -73,6 +73,8 @@ class Product { $this->price = 0; } + $this->price = round($this->price, 2); + $sql = "INSERT INTO llx_product (datec, fk_user_author, fk_product_type, price)"; $sql .= " VALUES (now(),".$user->id.",$this->type, " . ereg_replace(",",".",$this->price) . ")"; @@ -126,6 +128,8 @@ class Product { if (strlen(trim($this->price)) > 0 ) { + $this->price = round($this->price, 2); + $sql = "UPDATE llx_product "; $sql .= " SET price = " . ereg_replace(",",".",$this->price); $sql .= " WHERE rowid = " . $id;