On arrondit le prix 2 digits tant que l'on ne gre que 2 digits dans

le reste de l'appli
This commit is contained in:
Rodolphe Quiedeville 2003-09-15 18:36:03 +00:00
parent 594cdd9867
commit 9d24a5570a

View File

@ -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;