Hi. That's my problem: 
class MYCLASS { 
var $z = array(); 
function addOne($PRODUCT_ID,$IL,$PR) { 
$this->z[$PRODUCT_ID]=array("IL" => $IL, 
"PR" => $PR); 
} 
function myPrice() { 
$cn = 0.0; 
reset($this->z); 
while (list($id,$vals) = each($this->z)) { 
problem here! -> $cn=$cn + $vals["PR"]*$vals["IL"]; 
} 
reset($this->z); 
return $cn; 
} 
} 

Example to above: 
$this->z[1] = array ("IL" => 1, "PR" => 634.4); 
then function myPrice() counts $cn as 634 (not as 634.4)!!! 
It works like that even when I convert $vals["PR"] and $vals
["IL"] to floats. 

What's the problem?!?! 

Thank's for any help :) 


-----------------------------------------------------------------------
Prawdziwe okazje nie zdarzają się często!
Zobacz pełną ofertę! < http://zakupy.wp.pl >



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to