Commit ff097d46 by 黄静

hj

parent f73b8bf3
...@@ -48,10 +48,14 @@ class RiskComputer: ...@@ -48,10 +48,14 @@ class RiskComputer:
if(a not in self.IndexRes1): if(a not in self.IndexRes1):
self.IndexRes1[a]={Curr_Date:ret} self.IndexRes1[a]={Curr_Date:ret}
else: else:
if(Previous_Date not in self.IndexRes1[a]): if ret == 0:
self.IndexRes1[a][Previous_Date]=ret ret = str(ret)
else: elif ret == '—':
self.IndexRes1[a]["change_rate"]=ret ret = '—'
else:
ret1 = float('%.2f' % ret)
ret = str(ret1 * 100) + '%'
self.IndexRes1[a]["change_rate"] = ret
def Ret2Json(self):#把指标结果转化为樊辉需要的Json def Ret2Json(self):#把指标结果转化为樊辉需要的Json
#json写入数据库 #json写入数据库
# db = pymysql.connect(host='47.105.186.2',port=3307,user='caishui',password='jvmfTVDuG5YE(*Z',db='fktaxctl',charset="utf8mb4") # db = pymysql.connect(host='47.105.186.2',port=3307,user='caishui',password='jvmfTVDuG5YE(*Z',db='fktaxctl',charset="utf8mb4")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment