cloud-b2b 1.1.35 → 1.1.37
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/es/SuperTable2/SuperTable2.js +2 -2
- package/es/helper.js +3 -4
- package/lib/SuperTable2/SuperTable2.js +2 -2
- package/lib/helper.js +3 -4
- package/package.json +1 -1
|
@@ -586,10 +586,10 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
586
586
|
} else if (col.showPrice || col.decimalPlaces) {
|
|
587
587
|
col.render = function (text, record, index) {
|
|
588
588
|
if (col.showPrice && text) {
|
|
589
|
-
text = helper.toThousands(text, col.decimalPlaces ? col.decimalPlaces : 2
|
|
589
|
+
text = helper.toThousands(text, col.decimalPlaces ? col.decimalPlaces : 2);
|
|
590
590
|
return "\uFFE5".concat(text);
|
|
591
591
|
} else {
|
|
592
|
-
return text;
|
|
592
|
+
return "\uFFE5".concat(text.toFixed(2));
|
|
593
593
|
}
|
|
594
594
|
};
|
|
595
595
|
}
|
package/es/helper.js
CHANGED
|
@@ -96,16 +96,15 @@ var toThousands = function toThousands(number) {
|
|
|
96
96
|
var formattedNumber;
|
|
97
97
|
if (!_Number$isInteger(_parseFloat(number))) {
|
|
98
98
|
formattedNumber = Number(number).toFixed(fractionDigits);
|
|
99
|
+
}
|
|
100
|
+
if (removeTrailingZeros) {
|
|
101
|
+
//去除整数和小数部分末尾的零
|
|
99
102
|
formattedNumber = formattedNumber.replace(/(\.\d*?[1-9])0*$/, '$1').replace(/\.0*$/, '');
|
|
100
103
|
} else {
|
|
101
104
|
formattedNumber = Number(number).toLocaleString(undefined, {
|
|
102
105
|
minimumFractionDigits: fractionDigits,
|
|
103
106
|
maximumFractionDigits: fractionDigits
|
|
104
107
|
});
|
|
105
|
-
if (removeTrailingZeros) {
|
|
106
|
-
//去除整数和小数部分末尾的零
|
|
107
|
-
formattedNumber = formattedNumber.replace(/(\.\d*?[1-9])0*$/, '$1').replace(/\.0*$/, '');
|
|
108
|
-
}
|
|
109
108
|
}
|
|
110
109
|
return formattedNumber;
|
|
111
110
|
} else if (typeof number === 'string' && _includesInstanceProperty(number).call(number, '~')) {
|
|
@@ -599,10 +599,10 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
599
599
|
} else if (col.showPrice || col.decimalPlaces) {
|
|
600
600
|
col.render = function (text, record, index) {
|
|
601
601
|
if (col.showPrice && text) {
|
|
602
|
-
text = _helper["default"].toThousands(text, col.decimalPlaces ? col.decimalPlaces : 2
|
|
602
|
+
text = _helper["default"].toThousands(text, col.decimalPlaces ? col.decimalPlaces : 2);
|
|
603
603
|
return "\uFFE5".concat(text);
|
|
604
604
|
} else {
|
|
605
|
-
return text;
|
|
605
|
+
return "\uFFE5".concat(text.toFixed(2));
|
|
606
606
|
}
|
|
607
607
|
};
|
|
608
608
|
}
|
package/lib/helper.js
CHANGED
|
@@ -108,16 +108,15 @@ var toThousands = function toThousands(number) {
|
|
|
108
108
|
var formattedNumber;
|
|
109
109
|
if (!(0, _isInteger["default"])((0, _parseFloat2["default"])(number))) {
|
|
110
110
|
formattedNumber = Number(number).toFixed(fractionDigits);
|
|
111
|
+
}
|
|
112
|
+
if (removeTrailingZeros) {
|
|
113
|
+
//去除整数和小数部分末尾的零
|
|
111
114
|
formattedNumber = formattedNumber.replace(/(\.\d*?[1-9])0*$/, '$1').replace(/\.0*$/, '');
|
|
112
115
|
} else {
|
|
113
116
|
formattedNumber = Number(number).toLocaleString(undefined, {
|
|
114
117
|
minimumFractionDigits: fractionDigits,
|
|
115
118
|
maximumFractionDigits: fractionDigits
|
|
116
119
|
});
|
|
117
|
-
if (removeTrailingZeros) {
|
|
118
|
-
//去除整数和小数部分末尾的零
|
|
119
|
-
formattedNumber = formattedNumber.replace(/(\.\d*?[1-9])0*$/, '$1').replace(/\.0*$/, '');
|
|
120
|
-
}
|
|
121
120
|
}
|
|
122
121
|
return formattedNumber;
|
|
123
122
|
} else if (typeof number === 'string' && (0, _includes["default"])(number).call(number, '~')) {
|