@daysnap/utils 0.0.72 → 0.0.73
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/docs/interfaces/StorageManager.md +92 -0
- package/docs/interfaces/Trap.md +118 -0
- package/docs/modules.md +380 -102
- package/es/formatAmount.d.ts +1 -1
- package/es/formatAmount.js +2 -2
- package/lib/formatAmount.d.ts +1 -1
- package/lib/formatAmount.js +2 -2
- package/package.json +1 -1
package/es/formatAmount.d.ts
CHANGED
package/es/formatAmount.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 格式化金额,默认元
|
|
3
3
|
*/
|
|
4
|
-
export function formatAmount(s, radix = 1) {
|
|
4
|
+
export function formatAmount(s, radix = 1, digits = 2) {
|
|
5
5
|
const money = parseFloat(s === null || s === void 0 ? void 0 : s.toString());
|
|
6
6
|
if (money) {
|
|
7
7
|
// eslint-disable-next-line no-param-reassign
|
|
8
|
-
s = `${(money / radix).toFixed(
|
|
8
|
+
s = `${(money / radix).toFixed(digits)}`;
|
|
9
9
|
const l = s.split('.')[0].split('').reverse();
|
|
10
10
|
const r = s.split('.')[1];
|
|
11
11
|
let t = '';
|
package/lib/formatAmount.d.ts
CHANGED
package/lib/formatAmount.js
CHANGED
|
@@ -4,11 +4,11 @@ exports.formatAmount = void 0;
|
|
|
4
4
|
/**
|
|
5
5
|
* 格式化金额,默认元
|
|
6
6
|
*/
|
|
7
|
-
function formatAmount(s, radix = 1) {
|
|
7
|
+
function formatAmount(s, radix = 1, digits = 2) {
|
|
8
8
|
const money = parseFloat(s === null || s === void 0 ? void 0 : s.toString());
|
|
9
9
|
if (money) {
|
|
10
10
|
// eslint-disable-next-line no-param-reassign
|
|
11
|
-
s = `${(money / radix).toFixed(
|
|
11
|
+
s = `${(money / radix).toFixed(digits)}`;
|
|
12
12
|
const l = s.split('.')[0].split('').reverse();
|
|
13
13
|
const r = s.split('.')[1];
|
|
14
14
|
let t = '';
|