We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dae636b commit 3f522f2Copy full SHA for 3f522f2
MoneyConvertor.php
@@ -75,7 +75,22 @@ public function convert($numberStr) {
75
//判断是否为数字
76
if (!is_numeric($numberStr))
77
return '不是有效的货币数值';
78
-
+
79
+ //执行转换
80
+ self::convertor($numberStr);
81
82
+ //返回转换结果
83
+ return $this->resultString;
84
+ }
85
86
87
+ /**
88
+ * 执行转换
89
+ * ---------------------------------------------------
90
+ * @param $numberStr 将要转换的小写数字金额
91
+ * @return void
92
+ */
93
+ private function convertor($numberStr){
94
//分差整数与浮点位,整数和小数部分分开,分别进行转换
95
$cutedNumber = explode('.', (string)$numberStr);
96
@@ -89,9 +104,9 @@ public function convert($numberStr) {
104
105
//去除无用零字符
106
self::removeZero();
- return $this->resultString;
107
}
108
109
110
111
/**
97
112
* 对整数部分进行转换
0 commit comments