<script type="text/javascript"> function AddComma(text) { switch (text.value.length) { case 1: document.getElementById("txtNumber").value = "0.0" + text.value; break; default: var data = text.value.replace(".", ""); var first = data.substring(0, (data.length - 2)); var second = data.substring(data.length - 2); var temp = Math.abs(first) + "." + second; document.getElementById("txtNumber").value = temp; } } </script>
<input id="txtNumber" type="text" name="name" onkeyup="AddComma(this);" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)