easy3wui 1.5.40-beta1 → 1.5.40-beta3

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.
@@ -491,17 +491,35 @@ var _initialiseProps = function _initialiseProps() {
491
491
 
492
492
  this.numeralFormat = function (text) {
493
493
  var strText = text;
494
- if (text || text === 0 || isNaN(text)) {
495
- if (typeof text === 'string') {
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 {
496
503
  strText = text;
497
- } else if (typeof text === 'number') {
498
- if (Number.isInfinite(text) || isNaN(NaN)) {
499
- strText = text;
500
- } else {
501
- strText = (0, _numeral2['default'])(text).format('0,0.00');
502
- }
503
504
  }
505
+ } else {
506
+ strText = text;
504
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
+ // }
505
523
  return strText;
506
524
  };
507
525
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy3wui",
3
- "version": "1.5.40-beta1",
3
+ "version": "1.5.40-beta3",
4
4
  "description": "easy3wui components for react",
5
5
  "keywords": [
6
6
  "react",