asv-hlps 1.2.62 → 1.2.64
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/cjs/utils.js
CHANGED
|
@@ -497,22 +497,23 @@ const sumAmount = (tobs, property) => {
|
|
|
497
497
|
};
|
|
498
498
|
exports.sumAmount = sumAmount;
|
|
499
499
|
const formatAmountToString = (amount, opt) => {
|
|
500
|
+
let getAmount = amount;
|
|
500
501
|
switch (opt === null || opt === void 0 ? void 0 : opt.math) {
|
|
501
502
|
case "ceil":
|
|
502
|
-
Math.ceil(amount);
|
|
503
|
+
getAmount = Math.ceil(amount);
|
|
503
504
|
break;
|
|
504
505
|
case "floor":
|
|
505
|
-
Math.floor(amount);
|
|
506
|
+
getAmount = Math.floor(amount);
|
|
506
507
|
break;
|
|
507
508
|
default:
|
|
508
|
-
|
|
509
|
+
getAmount;
|
|
509
510
|
break;
|
|
510
511
|
}
|
|
511
512
|
switch (opt === null || opt === void 0 ? void 0 : opt.currency) {
|
|
512
513
|
case "cfa":
|
|
513
|
-
return (0, exports.formatToStringCfa)(
|
|
514
|
+
return (0, exports.formatToStringCfa)(getAmount);
|
|
514
515
|
default:
|
|
515
|
-
return (0, exports.formatToString)(
|
|
516
|
+
return (0, exports.formatToString)(getAmount);
|
|
516
517
|
}
|
|
517
518
|
};
|
|
518
519
|
exports.formatAmountToString = formatAmountToString;
|
package/lib/esm/utils.js
CHANGED
|
@@ -426,21 +426,22 @@ export const sumAmount = (tobs, property) => {
|
|
|
426
426
|
}, 0);
|
|
427
427
|
};
|
|
428
428
|
export const formatAmountToString = (amount, opt) => {
|
|
429
|
+
let getAmount = amount;
|
|
429
430
|
switch (opt === null || opt === void 0 ? void 0 : opt.math) {
|
|
430
431
|
case "ceil":
|
|
431
|
-
Math.ceil(amount);
|
|
432
|
+
getAmount = Math.ceil(amount);
|
|
432
433
|
break;
|
|
433
434
|
case "floor":
|
|
434
|
-
Math.floor(amount);
|
|
435
|
+
getAmount = Math.floor(amount);
|
|
435
436
|
break;
|
|
436
437
|
default:
|
|
437
|
-
|
|
438
|
+
getAmount;
|
|
438
439
|
break;
|
|
439
440
|
}
|
|
440
441
|
switch (opt === null || opt === void 0 ? void 0 : opt.currency) {
|
|
441
442
|
case "cfa":
|
|
442
|
-
return formatToStringCfa(
|
|
443
|
+
return formatToStringCfa(getAmount);
|
|
443
444
|
default:
|
|
444
|
-
return formatToString(
|
|
445
|
+
return formatToString(getAmount);
|
|
445
446
|
}
|
|
446
447
|
};
|