数字转换
<body onload="s()"> <input id="num_input" value="99995960" /> <span id="num_span"></span> </body> <script> function s(){ var num_input = document.getElementById("num_input"); var num_span = document.getElementById("num_span"); var input_value = eval(num_input.value); var num_span_int=parseInt(input_value); if(num_span_int>10000){ var fist=parseInt(num_span_int/10000); var second=parseInt(num_span_int%10000); var second_i=parseInt(second/100);
num_span.innerText=fist+"."+second_i+"万";
}
else{ num_span.innerText=input_value;} } </script>
耐得住寂寞,守得住繁华