eolink对数据进行四舍五入处理
下图“BalanceAmount”返回值显示小数点2位以后的值,这样就与预计匹配值不等导致脚本错误
对这个值进行四舍五入处理,比如返回值变成整数
var num = eo.env.envParam["BalanceAmount_1"]-eo.env.envParam['TradeFee']+eo.env.envParam['SalePrice']; num =Math.round(num); eo.env.envParam['BalanceAmount'] = num;
或者保留2位小数
var num = eo.env.envParam["BalanceAmount_1"]-eo.env.envParam['TradeFee']+eo.env.envParam['SalePrice']; num =Math.round((num) * 100) / 100; eo.env.envParam['BalanceAmount'] = num;