@dune2/tools 1.1.4 → 1.1.5
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/package.json +1 -1
- package/src/numbro/index.ts +35 -0
package/package.json
CHANGED
package/src/numbro/index.ts
CHANGED
|
@@ -255,6 +255,41 @@ export class Numbro {
|
|
|
255
255
|
return numbro(r);
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
+
/**
|
|
259
|
+
* 判断当前数是否大于 other
|
|
260
|
+
*/
|
|
261
|
+
gt(other: OperationParams): boolean {
|
|
262
|
+
return this.bigNumber.isGreaterThan(this.castToBigNumber(other));
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* 判断当前数是否大于等于 other
|
|
267
|
+
*/
|
|
268
|
+
gte(other: OperationParams): boolean {
|
|
269
|
+
return this.bigNumber.isGreaterThanOrEqualTo(this.castToBigNumber(other));
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* 判断当前数是否小于 other
|
|
274
|
+
*/
|
|
275
|
+
lt(other: OperationParams): boolean {
|
|
276
|
+
return this.bigNumber.isLessThan(this.castToBigNumber(other));
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* 判断当前数是否小于等于 other
|
|
281
|
+
*/
|
|
282
|
+
lte(other: OperationParams): boolean {
|
|
283
|
+
return this.bigNumber.isLessThanOrEqualTo(this.castToBigNumber(other));
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* 判断当前数是否等于 other
|
|
288
|
+
*/
|
|
289
|
+
eq(other: OperationParams): boolean {
|
|
290
|
+
return this.bigNumber.isEqualTo(this.castToBigNumber(other));
|
|
291
|
+
}
|
|
292
|
+
|
|
258
293
|
/**
|
|
259
294
|
* 两个数相除
|
|
260
295
|
* @see https://mikemcl.github.io/bignumber.js/#dividedBy
|