Esempio n. 1
0
 /**
  * NumberLibTest::testMoney()
  *
  * @return void
  */
 public function testMoney()
 {
     $is = NumberLib::money(22.11);
     $expected = '22,11 €';
     $this->assertSame($expected, $is);
     $is = NumberLib::money(-22.11);
     $expected = '-22,11 €';
     $this->assertSame($expected, $is);
 }
 /**
  * PrepaidAccount::getPaymentDescription()
  * For PayPal or other external payment providers.
  * @param integer $paymentAmount
  * @return void
  * 2012-01-12
  */
 public function getPaymentDescription($paymentAmount, $short = false)
 {
     App::uses('NumberLib', 'Tools.Utility');
     $amount = $paymentAmount;
     if ($this->Behaviors->loaded('Loadable') && ($finalAmount = $this->finalAmount($paymentAmount)) && $finalAmount != $paymentAmount) {
         $amount = $finalAmount;
     }
     $res = __('Account Deposition');
     if (!$short) {
         $res .= ': ' . NumberLib::money($amount);
     }
     if ($finalAmount != $paymentAmount) {
         $res .= ' (' . NumberLib::money($paymentAmount) . ' + ' . NumberLib::money((double) $finalAmount - (double) $paymentAmount) . ' Bonus)';
     }
     return $res;
 }