Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

the fmoney mul function is called with wrong parameter count

posted by plankton 8 years ago

mul is declared as

public function mul($multiplicand)
603 	    {

hard coded - 8 (probably precision)

410 	        $new_amount = $this->amount->mul($currency_value, 8)->div($new_currency_value, $new_precision+1)->round($new_precision);

$precision is passed again.

605 	        $new_amount = $this->amount->mul($multiplicand, $precision+1)->round($precision);

fMoney wraps an fNumber instance. $this->amount is actually referring to an fNumber object, which does accept a scale for the mul method.

posted by wbond 8 years ago