JS 百分比转小数

function per2num(per) {
    return per.replace(/([0-9.]+)%/, function (a, b) {return +b / 100;})
}

猜你喜欢

转载自xinjiatao.iteye.com/blog/2273746