[Add]增加VnTrader小数点显示配置参数

This commit is contained in:
vn.py 2018-03-21 12:39:27 +08:00
parent f2787e2390
commit 162b4cc7b6
4 changed files with 17 additions and 6 deletions

View File

@ -11,8 +11,10 @@
"logActive": true,
"logLevel": "debug",
"logConsole": false,
"logConsole": true,
"logFile": true,
"tdPenalty": ["IF", "IH", "IC"]
"tdPenalty": ["IF", "IH", "IC"],
"maxDecimal": 4
}

View File

@ -14,5 +14,7 @@
"logConsole": true,
"logFile": true,
"tdPenalty": ["IF", "IH", "IC"]
"tdPenalty": ["IF", "IH", "IC"],
"maxDecimal": 4
}

View File

@ -755,7 +755,7 @@ class TradingWidget(QtWidgets.QFrame):
self.comboOffset.addItems(self.offsetList)
self.spinPrice = QtWidgets.QDoubleSpinBox()
self.spinPrice.setDecimals(4)
self.spinPrice.setDecimals(globalSetting.get('maxDecimal', 4))
self.spinPrice.setMinimum(0)
self.spinPrice.setMaximum(100000)

View File

@ -10,9 +10,10 @@ import json
from datetime import datetime
from math import isnan
from vtGlobal import globalSetting
MAX_NUMBER = 10000000000000
MAX_DECIMAL = 4
MAX_DECIMAL = globalSetting.get('maxDecimal', 4)
#----------------------------------------------------------------------
def safeUnicode(value):
@ -40,7 +41,13 @@ def todayDate():
# 图标路径
iconPathDict = {}
path = os.path.abspath(os.path.dirname(__file__))
path = os.path.abspath(os.path.dirname(__file__)) # 遍历vnpy安装目录
for root, subdirs, files in os.walk(path):
for fileName in files:
if '.ico' in fileName:
iconPathDict[fileName] = os.path.join(root, fileName)
path = os.getcwd() # 遍历工作目录
for root, subdirs, files in os.walk(path):
for fileName in files:
if '.ico' in fileName: