好久没写代码了,写了个计算涨停价、跌停价,+7,+5,+2,-2,-5,-7的脚本,有需要的朋友自取哈
function fn(input) {
if (!input)
return;
const toFixed = (num) => Math.round((num + Number.E
PSIL ON) * 100) / 100;
const ret = [toFixed(input * 1.1), toFixed(input * 1.07), toFixed(input * 1.05), toFixed(input * 1.02), input, toFixed(input * 0.98), toFixed(input * 0.95), toFixed(input * 0.93), toFixed(input * 0.9)];
// console.log(JSON.stringify(ret, null, 2))
return ret;
}
fn(9.75)