Example #1
0
 /**
  * 大写金额
  */
 public function toCapital()
 {
     if ($this->currency->getCode() !== 'CNY') {
         return;
     }
     $result = Word::spell($this->integral, true);
     $result .= '圆';
     $percent = intval($this->millesimal / 10);
     if ($percent > 0) {
         $dime = intval($percent / 10);
         $result .= Word::num2char($dime, true) . '角';
         if ($cent = intval($percent % 10)) {
             $result .= Word::num2char($caps, true) . '分';
         }
     } else {
         $result .= '整';
     }
     return $result;
 }