From f28a4a64c825b02e32e79387e0a6763e934ce51d Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期一, 17 十一月 2025 16:01:09 +0800
Subject: [PATCH] feat(config): 更新生态圈API基础URL配置
---
common/math.js | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/common/math.js b/common/math.js
new file mode 100644
index 0000000..57e84fe
--- /dev/null
+++ b/common/math.js
@@ -0,0 +1,24 @@
+const $math = require('mathjs')
+export const math = {
+ add () {
+ return comp('add', arguments)
+ },
+ subtract () {
+ return comp('subtract', arguments)
+ },
+ multiply () {
+ return comp('multiply', arguments)
+ },
+ divide () {
+ return comp('divide', arguments)
+ }
+}
+
+function comp (_func, args) {
+ let t = $math.chain($math.bignumber(args[0]))
+ for (let i = 1; i < args.length; i++) {
+ t = t[_func]($math.bignumber(args[i]))
+ }
+ // 闃叉瓒呰繃6浣嶄娇鐢ㄧ瀛﹁鏁版硶
+ return parseFloat(t.done())
+}
\ No newline at end of file
--
Gitblit v1.9.1