Browse Source

修复currency字段值转换异常问题

jqh 4 years ago
parent
commit
a8835f3ba6
1 changed files with 1 additions and 4 deletions
  1. 1 4
      src/Form/Field/Currency.php

+ 1 - 4
src/Form/Field/Currency.php

@@ -71,9 +71,6 @@ class Currency extends Text
      */
     protected function prepareInputValue($value)
     {
-        if (empty($value)) {
-            $value = 0;
-        }
-        return str_replace(',', '', $value);
+        return is_string($value) ? str_replace(',', '', $value) : $value;
     }
 }