zmdms-utils 0.0.63 → 0.0.65
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/es/_virtual/_commonjsHelpers.js +3 -0
- package/dist/es/_virtual/decimal.js +7 -0
- package/dist/es/baseUrl.js +3 -3
- package/dist/es/constants.d.ts +2 -2
- package/dist/es/constants.js +2 -2
- package/dist/es/node_modules/decimal.js/decimal2.js +4930 -0
- package/dist/es/src/test.js +190 -58
- package/package.json +1 -1
- package/src/baseUrl.ts +3 -3
- package/src/constants.ts +2 -2
- package/src/test.js +111 -78
package/dist/es/src/test.js
CHANGED
|
@@ -1,71 +1,203 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../node_modules/decimal.js/decimal2.js';
|
|
2
|
+
import { exports as decimalExports } from '../_virtual/decimal.js';
|
|
2
3
|
|
|
3
|
-
function unescapeString(input) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
// function unescapeString(input) {
|
|
5
|
+
// if (!input) {
|
|
6
|
+
// return "";
|
|
7
|
+
// }
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
9
|
+
// const escapedChars = {
|
|
10
|
+
// "&": "&",
|
|
11
|
+
// "<": "<",
|
|
12
|
+
// ">": ">",
|
|
13
|
+
// """: '"',
|
|
14
|
+
// "'": "'",
|
|
15
|
+
// };
|
|
16
|
+
|
|
17
|
+
// return input.replace(/&(amp|lt|gt|quot|#039);/g, (match) => {
|
|
18
|
+
// return escapedChars[match] || match;
|
|
19
|
+
// });
|
|
20
|
+
// }
|
|
21
|
+
|
|
22
|
+
// function dangerouslySetXss(input) {
|
|
23
|
+
// if (!input) {
|
|
24
|
+
// return "";
|
|
25
|
+
// }
|
|
26
|
+
// const escapedChars = {
|
|
27
|
+
// "<": "<",
|
|
28
|
+
// ">": ">",
|
|
29
|
+
// " ": " ",
|
|
30
|
+
// "&": "&",
|
|
31
|
+
// """: '"',
|
|
32
|
+
// };
|
|
33
|
+
|
|
34
|
+
// return input.replace(/&(amp|lt|gt|quot|nbsp);/g, (match) => {
|
|
35
|
+
// return escapedChars[match] || match;
|
|
36
|
+
// });
|
|
37
|
+
// }
|
|
38
|
+
|
|
39
|
+
// function dangerouslySetXss1(input) {
|
|
40
|
+
// if (!input) {
|
|
41
|
+
// return "";
|
|
42
|
+
// }
|
|
43
|
+
// const escapedChars = {
|
|
44
|
+
// lt: "<",
|
|
45
|
+
// gt: ">",
|
|
46
|
+
// nbsp: " ",
|
|
47
|
+
// amp: "&",
|
|
48
|
+
// quot: '"',
|
|
49
|
+
// };
|
|
50
|
+
|
|
51
|
+
// return input.replace(/&(amp|lt|gt|quot|nbsp);/gi, (match, t) => {
|
|
52
|
+
// return escapedChars[t] || match;
|
|
53
|
+
// });
|
|
54
|
+
// }
|
|
55
|
+
|
|
56
|
+
// console.log(unescapeString("&&&啊你"));
|
|
57
|
+
|
|
58
|
+
// console.log(dangerouslySetXss("&&&啊你"));
|
|
59
|
+
|
|
60
|
+
// console.log(dangerouslySetXss1("&&&啊你"));
|
|
61
|
+
// console.log(unescapeString("1、aa>80%\n2、><\n3、ss<80%"));
|
|
62
|
+
// console.log(dangerouslySetXss("1、aa>80%\n2、><\n3、ss<80%"));
|
|
63
|
+
// console.log(dangerouslySetXss1("1、aa>80%\n2、><\n3、ss<80%"));
|
|
64
|
+
|
|
65
|
+
// const dayjs = require("dayjs");
|
|
66
|
+
|
|
67
|
+
// const a = dayjs("2023-01-01 11:11").startOf("day");
|
|
68
|
+
// const formattedDate = a.format("YYYY-MM-DD HH:mm:ss");
|
|
69
|
+
|
|
70
|
+
// const b = dayjs("2023-01-01").endOf("day");
|
|
71
|
+
// const formattedDate1 = b.format("YYYY-MM-DD HH:mm:ss");
|
|
72
|
+
// console.log(formattedDate, formattedDate1);
|
|
73
|
+
|
|
74
|
+
// functions and constants
|
|
75
|
+
// console.log("functions and constants");
|
|
76
|
+
// print(math.round(math.e, 3)); // 2.718
|
|
77
|
+
// print(math.atan2(3, -3) / math.pi); // 0.75
|
|
78
|
+
// print(math.log(10000, 10)); // 4
|
|
79
|
+
// print(math.sqrt(-4)); // 2i
|
|
80
|
+
// print(
|
|
81
|
+
// math.pow(
|
|
82
|
+
// [
|
|
83
|
+
// [-1, 2],
|
|
84
|
+
// [3, 1],
|
|
85
|
+
// ],
|
|
86
|
+
// 2
|
|
87
|
+
// )
|
|
88
|
+
// ); // [[7, 0], [0, 7]]
|
|
89
|
+
// print(math.derivative("x^2 + x", "x")); // 2 * x + 1
|
|
90
|
+
// console.log();
|
|
20
91
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
92
|
+
// // expressions
|
|
93
|
+
// console.log("expressions");
|
|
94
|
+
// print(math.evaluate("1.2 * (2 + 4.5)")); // 7.8
|
|
95
|
+
// print(math.evaluate("12.7 cm to inch")); // 5 inch
|
|
96
|
+
// print(math.evaluate("sin(45 deg) ^ 2")); // 0.5
|
|
97
|
+
// print(math.evaluate("9 / 3 + 2i")); // 3 + 2i
|
|
98
|
+
// print(math.evaluate("det([-1, 2; 3, 1])")); // -7
|
|
99
|
+
// print(math.evaluate("NaN + '0.2'")); // -7
|
|
100
|
+
// console.log();
|
|
101
|
+
|
|
102
|
+
// // chained operations
|
|
103
|
+
// console.log("chained operations");
|
|
104
|
+
// const a = math.chain(3).add(4).multiply(2).done();
|
|
105
|
+
// print(a); // 14
|
|
106
|
+
// console.log();
|
|
107
|
+
|
|
108
|
+
// // mixed use of different data types in functions
|
|
109
|
+
// console.log("mixed use of data types");
|
|
110
|
+
// print(math.add(4, [5, 6])); // number + Array, [9, 10]
|
|
111
|
+
// print(math.multiply(math.unit("5 mm"), 3)); // Unit * number, 15 mm
|
|
112
|
+
// print(math.subtract([2, 3, 4], 5)); // Array - number, [-3, -2, -1]
|
|
113
|
+
// print(math.add(math.matrix([2, 3]), [4, 5])); // Matrix + Array, [6, 8]
|
|
114
|
+
// console.log();
|
|
115
|
+
|
|
116
|
+
// /**
|
|
117
|
+
// * Helper function to output a value in the console. Value will be formatted.
|
|
118
|
+
// * @param {*} value
|
|
119
|
+
// */
|
|
120
|
+
// function print(value) {
|
|
121
|
+
// const precision = 14;
|
|
122
|
+
// console.log(math.format(value, precision));
|
|
123
|
+
// }
|
|
124
|
+
|
|
125
|
+
// const math = require("mathjs");
|
|
126
|
+
// function print(value) {
|
|
127
|
+
// const precision = 14;
|
|
128
|
+
// console.log(math.format(value, precision));
|
|
129
|
+
// }
|
|
130
|
+
|
|
131
|
+
// console.log(performance.now());
|
|
132
|
+
// console.log(math.add(0.1, 0.2));
|
|
133
|
+
// console.log(performance.now());
|
|
134
|
+
// console.log(performance.now());
|
|
135
|
+
// console.log(0.1 + 0.2);
|
|
136
|
+
// console.log(performance.now());
|
|
137
|
+
// const BigNumber = require("bignumber.js");
|
|
138
|
+
// console.log(performance.now());
|
|
139
|
+
// const num1 = new BigNumber(0.1);
|
|
140
|
+
// const num2 = new BigNumber(0.2);
|
|
141
|
+
|
|
142
|
+
// const result = num1.plus(num2);
|
|
143
|
+
|
|
144
|
+
// console.log(result.toString());
|
|
145
|
+
|
|
146
|
+
// console.log(performance.now());
|
|
147
|
+
|
|
148
|
+
const Decimal = decimalExports;
|
|
149
|
+
|
|
150
|
+
function initNum(num1, num2) {
|
|
151
|
+
// 如果两个数都是非数字 那么直接返回0
|
|
152
|
+
if (isNaN(num1) && isNaN(num2)) {
|
|
153
|
+
return 0;
|
|
154
|
+
}
|
|
155
|
+
if (isNaN(num1)) {
|
|
156
|
+
return num2;
|
|
157
|
+
}
|
|
158
|
+
if (isNaN(num2)) {
|
|
159
|
+
return num1;
|
|
24
160
|
}
|
|
25
|
-
const escapedChars = {
|
|
26
|
-
"<": "<",
|
|
27
|
-
">": ">",
|
|
28
|
-
" ": " ",
|
|
29
|
-
"&": "&",
|
|
30
|
-
""": '"',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
return input.replace(/&(amp|lt|gt|quot|nbsp);/g, (match) => {
|
|
34
|
-
return escapedChars[match] || match;
|
|
35
|
-
});
|
|
36
161
|
}
|
|
37
162
|
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
|
|
163
|
+
function times(num1, num2) {
|
|
164
|
+
try {
|
|
165
|
+
const _num1 = num1 == null ? NaN : Number(num1);
|
|
166
|
+
const _num2 = num2 == null ? NaN : Number(num2);
|
|
167
|
+
// 如果两个数都是非数字 那么直接返回0
|
|
168
|
+
const result = initNum(_num1, _num2);
|
|
169
|
+
if (typeof result === "number") {
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
172
|
+
return new Decimal(_num1).mul(_num2).toNumber();
|
|
173
|
+
// return (isNaN(_num1) ? 0 : _num1) * (isNaN(_num2) ? 0 : _num2);
|
|
174
|
+
} catch (err) {
|
|
175
|
+
console.error("计算乘法出错", err);
|
|
176
|
+
return 0;
|
|
41
177
|
}
|
|
42
|
-
const escapedChars = {
|
|
43
|
-
lt: "<",
|
|
44
|
-
gt: ">",
|
|
45
|
-
nbsp: " ",
|
|
46
|
-
amp: "&",
|
|
47
|
-
quot: '"',
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
return input.replace(/&(amp|lt|gt|quot|nbsp);/gi, (match, t) => {
|
|
51
|
-
return escapedChars[t] || match;
|
|
52
|
-
});
|
|
53
178
|
}
|
|
54
179
|
|
|
55
|
-
console.log(
|
|
56
|
-
|
|
57
|
-
|
|
180
|
+
console.log(times(78.11, 0.77));
|
|
181
|
+
console.log(times(7777777.77, 1.1));
|
|
182
|
+
// 7777777.77 * 1.1
|
|
183
|
+
const num1 = new Decimal("78.11");
|
|
58
184
|
|
|
59
|
-
console.log(
|
|
60
|
-
console.log(unescapeString("1、aa>80%\n2、><\n3、ss<80%"));
|
|
61
|
-
console.log(dangerouslySetXss("1、aa>80%\n2、><\n3、ss<80%"));
|
|
62
|
-
console.log(dangerouslySetXss1("1、aa>80%\n2、><\n3、ss<80%"));
|
|
185
|
+
// console.log(num1.add(0.21).toNumber(), typeof num1.add(0.21).toNumber());
|
|
63
186
|
|
|
64
|
-
|
|
187
|
+
// console.log(num1.sub(0.21).toNumber(), typeof num1.sub(0.21).toNumber());
|
|
65
188
|
|
|
66
|
-
|
|
67
|
-
|
|
189
|
+
console.log(num1.mul(0.77).toNumber(), typeof num1.mul(0.21).toNumber());
|
|
190
|
+
Decimal.set({ precision: 5 });
|
|
191
|
+
console.log(
|
|
192
|
+
new Decimal(1).div(1.1).toNumber(),
|
|
193
|
+
typeof new Decimal(1).div(1.1).toNumber()
|
|
194
|
+
);
|
|
195
|
+
console.log(
|
|
196
|
+
new Decimal(1).dividedBy(1.1).toNumber(),
|
|
197
|
+
typeof new Decimal(1).dividedBy(1.1).toNumber()
|
|
198
|
+
);
|
|
68
199
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
200
|
+
console.log(
|
|
201
|
+
Number(new Decimal(1.1).toFixed(2)),
|
|
202
|
+
typeof Number(new Decimal(1.1).toFixed(2)).toFixed(2)
|
|
203
|
+
);
|
package/package.json
CHANGED
package/src/baseUrl.ts
CHANGED
|
@@ -61,10 +61,10 @@ export function getBaseUrl(processObj: any, options?: IOptions) {
|
|
|
61
61
|
// 退出登录地址
|
|
62
62
|
const logoutUrl: any = {
|
|
63
63
|
dev: processObj[`${logoutKey}_DEV`] || "/login",
|
|
64
|
-
test: processObj[`${logoutKey}
|
|
64
|
+
test: processObj[`${logoutKey}_TEST`] || "/login",
|
|
65
65
|
stage:
|
|
66
|
-
processObj[`${logoutKey}
|
|
67
|
-
prod: processObj[`${logoutKey}
|
|
66
|
+
processObj[`${logoutKey}_STAGE`] || "http://testportal.cncico.com:8099/",
|
|
67
|
+
prod: processObj[`${logoutKey}_PROD`] || "http://newportal.cncico.com/",
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
const currentKey = ENV.toLowerCase() || "prod";
|
package/src/constants.ts
CHANGED
|
@@ -26,8 +26,8 @@ export const EMITTER_TYPE = {
|
|
|
26
26
|
|
|
27
27
|
// token key 值
|
|
28
28
|
// export const TOKEN_KEY = "Zmdms-Auth";
|
|
29
|
-
export const TOKEN_KEY = "Cicoms-Auth";
|
|
29
|
+
export const TOKEN_KEY = (window as any).__TOKEN_KEY__ || "Cicoms-Auth";
|
|
30
30
|
|
|
31
31
|
// 基础前缀
|
|
32
32
|
// export const BASIC_KEY = "zmdms";
|
|
33
|
-
export const BASIC_KEY = "cicoms";
|
|
33
|
+
export const BASIC_KEY = (window as any).__BASIC_KEY__ || "cicoms";
|
package/src/test.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
function unescapeString(input) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
1
|
+
// function unescapeString(input) {
|
|
2
|
+
// if (!input) {
|
|
3
|
+
// return "";
|
|
4
|
+
// }
|
|
5
|
+
|
|
6
|
+
// const escapedChars = {
|
|
7
|
+
// "&": "&",
|
|
8
|
+
// "<": "<",
|
|
9
|
+
// ">": ">",
|
|
10
|
+
// """: '"',
|
|
11
|
+
// "'": "'",
|
|
12
|
+
// };
|
|
13
|
+
|
|
14
|
+
// return input.replace(/&(amp|lt|gt|quot|#039);/g, (match) => {
|
|
15
|
+
// return escapedChars[match] || match;
|
|
16
|
+
// });
|
|
17
|
+
// }
|
|
18
18
|
|
|
19
|
-
function dangerouslySetXss(input) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
19
|
+
// function dangerouslySetXss(input) {
|
|
20
|
+
// if (!input) {
|
|
21
|
+
// return "";
|
|
22
|
+
// }
|
|
23
|
+
// const escapedChars = {
|
|
24
|
+
// "<": "<",
|
|
25
|
+
// ">": ">",
|
|
26
|
+
// " ": " ",
|
|
27
|
+
// "&": "&",
|
|
28
|
+
// """: '"',
|
|
29
|
+
// };
|
|
30
|
+
|
|
31
|
+
// return input.replace(/&(amp|lt|gt|quot|nbsp);/g, (match) => {
|
|
32
|
+
// return escapedChars[match] || match;
|
|
33
|
+
// });
|
|
34
|
+
// }
|
|
35
35
|
|
|
36
|
-
function dangerouslySetXss1(input) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
36
|
+
// function dangerouslySetXss1(input) {
|
|
37
|
+
// if (!input) {
|
|
38
|
+
// return "";
|
|
39
|
+
// }
|
|
40
|
+
// const escapedChars = {
|
|
41
|
+
// lt: "<",
|
|
42
|
+
// gt: ">",
|
|
43
|
+
// nbsp: " ",
|
|
44
|
+
// amp: "&",
|
|
45
|
+
// quot: '"',
|
|
46
|
+
// };
|
|
47
|
+
|
|
48
|
+
// return input.replace(/&(amp|lt|gt|quot|nbsp);/gi, (match, t) => {
|
|
49
|
+
// return escapedChars[t] || match;
|
|
50
|
+
// });
|
|
51
|
+
// }
|
|
52
52
|
|
|
53
|
-
console.log(unescapeString("&&&啊你"));
|
|
53
|
+
// console.log(unescapeString("&&&啊你"));
|
|
54
54
|
|
|
55
|
-
console.log(dangerouslySetXss("&&&啊你"));
|
|
55
|
+
// console.log(dangerouslySetXss("&&&啊你"));
|
|
56
56
|
|
|
57
|
-
console.log(dangerouslySetXss1("&&&啊你"));
|
|
58
|
-
console.log(unescapeString("1、aa>80%\n2、><\n3、ss<80%"));
|
|
59
|
-
console.log(dangerouslySetXss("1、aa>80%\n2、><\n3、ss<80%"));
|
|
60
|
-
console.log(dangerouslySetXss1("1、aa>80%\n2、><\n3、ss<80%"));
|
|
57
|
+
// console.log(dangerouslySetXss1("&&&啊你"));
|
|
58
|
+
// console.log(unescapeString("1、aa>80%\n2、><\n3、ss<80%"));
|
|
59
|
+
// console.log(dangerouslySetXss("1、aa>80%\n2、><\n3、ss<80%"));
|
|
60
|
+
// console.log(dangerouslySetXss1("1、aa>80%\n2、><\n3、ss<80%"));
|
|
61
61
|
|
|
62
|
-
const dayjs = require("dayjs");
|
|
62
|
+
// const dayjs = require("dayjs");
|
|
63
63
|
|
|
64
|
-
const a = dayjs("2023-01-01 11:11").startOf("day");
|
|
65
|
-
const formattedDate = a.format("YYYY-MM-DD HH:mm:ss");
|
|
64
|
+
// const a = dayjs("2023-01-01 11:11").startOf("day");
|
|
65
|
+
// const formattedDate = a.format("YYYY-MM-DD HH:mm:ss");
|
|
66
66
|
|
|
67
|
-
const b = dayjs("2023-01-01").endOf("day");
|
|
68
|
-
const formattedDate1 = b.format("YYYY-MM-DD HH:mm:ss");
|
|
69
|
-
console.log(formattedDate, formattedDate1);
|
|
67
|
+
// const b = dayjs("2023-01-01").endOf("day");
|
|
68
|
+
// const formattedDate1 = b.format("YYYY-MM-DD HH:mm:ss");
|
|
69
|
+
// console.log(formattedDate, formattedDate1);
|
|
70
70
|
|
|
71
71
|
// functions and constants
|
|
72
72
|
// console.log("functions and constants");
|
|
@@ -142,26 +142,59 @@ console.log(formattedDate, formattedDate1);
|
|
|
142
142
|
|
|
143
143
|
// console.log(performance.now());
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
const Decimal = require("decimal.js");
|
|
146
|
+
|
|
147
|
+
function initNum(num1, num2) {
|
|
148
|
+
// 如果两个数都是非数字 那么直接返回0
|
|
149
|
+
if (isNaN(num1) && isNaN(num2)) {
|
|
150
|
+
return 0;
|
|
151
|
+
}
|
|
152
|
+
if (isNaN(num1)) {
|
|
153
|
+
return num2;
|
|
154
|
+
}
|
|
155
|
+
if (isNaN(num2)) {
|
|
156
|
+
return num1;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function times(num1, num2) {
|
|
161
|
+
try {
|
|
162
|
+
const _num1 = num1 == null ? NaN : Number(num1);
|
|
163
|
+
const _num2 = num2 == null ? NaN : Number(num2);
|
|
164
|
+
// 如果两个数都是非数字 那么直接返回0
|
|
165
|
+
const result = initNum(_num1, _num2);
|
|
166
|
+
if (typeof result === "number") {
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
return new Decimal(_num1).mul(_num2).toNumber();
|
|
170
|
+
// return (isNaN(_num1) ? 0 : _num1) * (isNaN(_num2) ? 0 : _num2);
|
|
171
|
+
} catch (err) {
|
|
172
|
+
console.error("计算乘法出错", err);
|
|
173
|
+
return 0;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
146
176
|
|
|
147
|
-
|
|
177
|
+
console.log(times(78.11, 0.77));
|
|
178
|
+
console.log(times(7777777.77, 1.1));
|
|
179
|
+
// 7777777.77 * 1.1
|
|
180
|
+
const num1 = new Decimal("78.11");
|
|
148
181
|
|
|
149
182
|
// console.log(num1.add(0.21).toNumber(), typeof num1.add(0.21).toNumber());
|
|
150
183
|
|
|
151
184
|
// console.log(num1.sub(0.21).toNumber(), typeof num1.sub(0.21).toNumber());
|
|
152
185
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
186
|
+
console.log(num1.mul(0.77).toNumber(), typeof num1.mul(0.21).toNumber());
|
|
187
|
+
Decimal.set({ precision: 5 });
|
|
188
|
+
console.log(
|
|
189
|
+
new Decimal(1).div(1.1).toNumber(),
|
|
190
|
+
typeof new Decimal(1).div(1.1).toNumber()
|
|
191
|
+
);
|
|
192
|
+
console.log(
|
|
193
|
+
new Decimal(1).dividedBy(1.1).toNumber(),
|
|
194
|
+
typeof new Decimal(1).dividedBy(1.1).toNumber()
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
console.log(
|
|
198
|
+
Number(new Decimal(1.1).toFixed(2)),
|
|
199
|
+
typeof Number(new Decimal(1.1).toFixed(2)).toFixed(2)
|
|
200
|
+
);
|