diff --git a/YLErpWeb/wwwroot/Scripts/app/scenario/tradeScenario.js b/YLErpWeb/wwwroot/Scripts/app/scenario/tradeScenario.js index ccdd4c86..c30a7782 100644 --- a/YLErpWeb/wwwroot/Scripts/app/scenario/tradeScenario.js +++ b/YLErpWeb/wwwroot/Scripts/app/scenario/tradeScenario.js @@ -13,20 +13,12 @@ const colModelGrid = (function () { } function StrikeFormatter(cellValue, options, rowObject) { - if (rowObject.Strike) { - if (rowObject.IsMoneynessOption === "是") { - return otcformat.trading.premiumRateP(rowObject.Strike); - } else { - return otcformat.trading.umprice(rowObject.Strike); - } - } else { - if (rowObject.Strike === 0) { - return 0; - } - else { - return ""; - } - } + if (cellValue === null || cellValue === undefined || cellValue === '' || cellValue === 'NaN') return ''; + var strike = Number(cellValue); + if (!isFinite(strike)) return ''; + return rowObject.IsMoneynessOption === "是" + ? (strike * 100).toFixed(2) + '%' + : strike.toFixed(2); } var col = [ @@ -273,4 +265,4 @@ function setTestValue(list) { testStstus = false; main.alert("计算完成"); } -} \ No newline at end of file +}