Permalink
Browse files

BackwardsCompatibilityBreak - fMoney::multiply() is now fMoney::mul()…

… and fMoney::subtract() is now fMoney::sub(), makes fMoney and fNumber APIs consistent and fixes ticket #53
  • Loading branch information...
wbond committed Aug 31, 2008
1 parent 5fc2aa3 commit 980845ca1563c717a5a841d14c8aa194582bfcaa
Showing with 2 additions and 2 deletions.
  1. +2 −2 classes/ecommerce/fMoney.php
@@ -487,7 +487,7 @@ public function lte(fMoney $money)
* @param fNumber|string $multiplicand The number of times to multiply this ammount - don't use a float since they are imprecise
* @return fMoney The product of the monetary value and the multiplicand passed
*/
public function multiply($multiplicand)
public function mul($multiplicand)
{
$new_amount = $this->amount->mul($multiplicand);
return new fMoney($new_amount, $this->currency);
@@ -512,7 +512,7 @@ protected function round()
* @param fMoney $subtrahend The money object to subtract
* @return fMoney The difference of the monetary values in this currency
*/
public function subtract(fMoney $subtrahend)
public function sub(fMoney $subtrahend)
{
$converted_subtrahend = $subtrahend->convert($this->currency)->amount;
$new_amount = $this->amount->sub($converted_subtrahend);

0 comments on commit 980845c

Please sign in to comment.