!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
HTML>
HEAD>
TITLE> New Document /TITLE>
META NAME="Generator" CONTENT="EditPlus">
META NAME="Author" CONTENT="">
META NAME="Keywords" CONTENT="">
META NAME="Description" CONTENT="">
/HEAD>
BODY>
input onkeyup='check(this)'/>
/BODY>
script>
function check(obj){
var sreg = /^-+.*/g;
var zero = /^0[1-9]+\.*\d*/g;
var val = obj.value;
var plus = '';
if(sreg.test(val)){
val = val.replace(/-+/g,'');
plus = '-';
}
val = val.replace(/\s+/g,'');
if(/^\.+.*$/.test(val)){
val = '';
}
val = val.replace(/[^\d\.]/,'');
val = val.replace(/(^\d+\.{1})(\d*).*/g,'$1$2');
val = val.replace(/(^\d+\.\d{3})\d*/g,'$1');
val = val.replace(/^[0]*(0{1})([1-9]*)(.*)/g,'$1$2$3');
if(zero.test(val)){
val = val.replace(/0([1-9]+)(.*)$/,'$1$2');
}
obj.value = plus+val;
}
/script>
/HTML>