<script language="javascript" type="text/javascript">
function comdify(n){
var re=/\d{1,3}(?=(\d{3})+$)/g;
var n1=n.replace(/^(\d+)((\.\d+)?)$/,function(s,s1,s2){return s1.replace(re,"$&,")+s2;});
return n1;
}
</script>
<input type="text" value="1212133345.78" onblur="this.value=comdify(this.value)">
时间: 2024-10-08 15:46:52