Example #1
0
 /**
  * @param int|float $amount
  * @param int       $percentage
  *
  * @return float|int
  */
 public function formatPercentage($amount, $percentage = 0)
 {
     if ($percentage > 0) {
         if ($amount instanceof Money) {
             return $amount->multiply($percentage);
         }
         return $amount * $percentage;
     }
     return 0;
 }