Przeglądaj źródła

fix: 修复预付款新建期报错的bug

lanjianrong 4 lat temu
rodzic
commit
50f84832fe
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      app/extend/helper.js

+ 4 - 1
app/extend/helper.js

@@ -822,7 +822,10 @@ module.exports = {
         return '';
     },
     formatMoney(s = 0, dot = ',', decimal = 2) {
-        if (!s) return s.toFixed(decimal);
+        if (!s) {
+            s = 0;
+            return s.toFixed(decimal);
+        }
         s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(decimal === 0 ? 2 : decimal) + '';
         const l = s.split('.')[0].split('').reverse(),
             r = s.split('.')[1];