Pārlūkot izejas kodu

数值转string

JiahengHe 1 gadu atpakaļ
vecāks
revīzija
4c9ce98733
2 mainītis faili ar 6 papildinājumiem un 6 dzēšanām
  1. 3 3
      strategy/src/model.rs
  2. 3 3
      strategy/src/strategy.rs

+ 3 - 3
strategy/src/model.rs

@@ -134,11 +134,11 @@ pub struct OriginalTicker {
 #[derive(Serialize, Deserialize, Debug)]
 pub struct DealRecord {
     // 参考价
-    pub refPrice: Decimal,
+    pub refPrice: String,
     // 挂单价
-    pub regPrice: Decimal,
+    pub regPrice: String,
     // 买单最优挂单数量
-    pub num: Decimal,
+    pub num: String,
     // 触发时间
     pub triggerTime: i64,
     // 机器名称

+ 3 - 3
strategy/src/strategy.rs

@@ -1278,9 +1278,9 @@ fn paras_limit_command (robot_name: String, time: i64, ref_ap: Decimal, ref_bp:
             ref_price = ref_bp;
         }
         let deal_recode = DealRecord {
-            refPrice: ref_price,
-            regPrice: price,
-            num: amount,
+            refPrice: ref_price.to_string(),
+            regPrice: price.to_string(),
+            num: amount.to_string(),
             triggerTime: time,
             robotName: robot_name.clone(),
             side: side.to_string(),