easy3wui 1.5.40-beta2 → 1.5.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Easy3wGridPage/index.js +27 -13
- package/package.json +1 -1
|
@@ -491,21 +491,35 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
491
491
|
|
|
492
492
|
this.numeralFormat = function (text) {
|
|
493
493
|
var strText = text;
|
|
494
|
-
if (
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
} else {
|
|
505
|
-
strText = (0, _numeral2['default'])(text).format('0,0.00');
|
|
506
|
-
}
|
|
494
|
+
if (Number.isFinite(text)) {
|
|
495
|
+
// 有限值数字 用于检查一个数值是否是有限的。如果数值是有限数(即不是 Infinity、-Infinity 或 NaN),那么 Number.isFinite() 返回 true,否则返回 false。
|
|
496
|
+
strText = (0, _numeral2['default'])(text).format('0,0.00');
|
|
497
|
+
} else if (typeof text === 'string') {
|
|
498
|
+
// 字符串
|
|
499
|
+
if (/^\d+(\.\d+)?$/.test(text)) {
|
|
500
|
+
// 数字字符串
|
|
501
|
+
strText = (0, _numeral2['default'])(text).format('0,0.00');
|
|
502
|
+
} else {
|
|
503
|
+
strText = text;
|
|
507
504
|
}
|
|
505
|
+
} else {
|
|
506
|
+
strText = text;
|
|
508
507
|
}
|
|
508
|
+
// if (text || text === 0 || isNaN(text)) {
|
|
509
|
+
// if (typeof text === 'string') {
|
|
510
|
+
// if (/^\d+(\.\d+)?$/.test(text)) {
|
|
511
|
+
// strText = numeral(text).format('0,0.00');
|
|
512
|
+
// } else {
|
|
513
|
+
// strText = text;
|
|
514
|
+
// }
|
|
515
|
+
// } else if (typeof text === 'number') {
|
|
516
|
+
// if (Number.isInfinite(text) || isNaN(NaN)) {
|
|
517
|
+
// strText = text;
|
|
518
|
+
// } else {
|
|
519
|
+
// strText = numeral(text).format('0,0.00');
|
|
520
|
+
// }
|
|
521
|
+
// }
|
|
522
|
+
// }
|
|
509
523
|
return strText;
|
|
510
524
|
};
|
|
511
525
|
|