util-helpers 4.23.6 → 4.23.7
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/dist/util-helpers.js +5 -6
- package/dist/util-helpers.js.map +1 -1
- package/dist/util-helpers.min.js +1 -1
- package/dist/util-helpers.min.js.map +1 -1
- package/esm/VERSION.js +1 -1
- package/esm/formatMoney.js +4 -5
- package/esm/index.js +1 -1
- package/lib/VERSION.js +1 -1
- package/lib/formatMoney.js +3 -4
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/types/formatMoney.d.ts +2 -0
package/dist/util-helpers.js
CHANGED
|
@@ -909,10 +909,9 @@
|
|
|
909
909
|
return decimal + ret;
|
|
910
910
|
}
|
|
911
911
|
var formatMoney = function (num, options) {
|
|
912
|
-
if (num === void 0) { num = ''; }
|
|
913
912
|
if (options === void 0) { options = {}; }
|
|
914
|
-
var _a = options.precision, precision = _a === void 0 ? 2 : _a, symbol = options.symbol, _b = options.thousand, thousand = _b === void 0 ? ',' : _b, _c = options.decimal, decimal = _c === void 0 ? '.' : _c;
|
|
915
|
-
if (!checkNumber(num)) {
|
|
913
|
+
var _a = options.precision, precision = _a === void 0 ? 2 : _a, symbol = options.symbol, _b = options.thousand, thousand = _b === void 0 ? ',' : _b, _c = options.decimal, decimal = _c === void 0 ? '.' : _c, _d = options.strict, strict = _d === void 0 ? true : _d;
|
|
914
|
+
if (!checkNumber(num) || (strict && (!isString(num) || num === '') && !isNumber(num))) {
|
|
916
915
|
return '';
|
|
917
916
|
}
|
|
918
917
|
if (typeof num === 'number' && !isFinite(num)) {
|
|
@@ -928,7 +927,7 @@
|
|
|
928
927
|
thousand = typeof thousand === 'string' ? thousand : ',';
|
|
929
928
|
decimal = typeof decimal === 'string' ? decimal : '.';
|
|
930
929
|
var strNum = transformEffectiveNumber(num) + '';
|
|
931
|
-
var
|
|
930
|
+
var _e = __read(strNum.split('.'), 2), intStr = _e[0], decStr = _e[1];
|
|
932
931
|
return symbol + formatInt(intStr, thousand) + formatDec(decStr, precision, decimal);
|
|
933
932
|
};
|
|
934
933
|
|
|
@@ -2599,9 +2598,9 @@
|
|
|
2599
2598
|
return internalFindTreeSelect(tree, predicate, childrenField);
|
|
2600
2599
|
}
|
|
2601
2600
|
|
|
2602
|
-
var VERSION = "4.23.
|
|
2601
|
+
var VERSION = "4.23.7";
|
|
2603
2602
|
|
|
2604
|
-
var version = "4.23.
|
|
2603
|
+
var version = "4.23.7";
|
|
2605
2604
|
|
|
2606
2605
|
exports.AsyncMemo = AsyncMemo;
|
|
2607
2606
|
exports.VERSION = VERSION;
|