js小数和百分数的转换
一、百分数转化为小数
function toPoint(percent){ var str=percent.replace("%",""); str= str/100; return str; }
二、小数转化为百分数
function toPercent(point){ var str=Number(point*100).toFixed(1); str+="%"; return str; }
一、百分数转化为小数
function toPoint(percent){ var str=percent.replace("%",""); str= str/100; return str; }
二、小数转化为百分数
function toPercent(point){ var str=Number(point*100).toFixed(1); str+="%"; return str; }