What we are trying to achieve.
Input Format => 10
Output Format => 10.00
Let us now see, how to accomplish this.
Add the required TextBox or Grid/DataView controls to the page.
alert('Please enter a valid Number');
objTxt.value = '0.00';
//Converts value 10 into the Format 10.00
objTxt.value = parseFloat(objTxt.value).toFixed(2);
That's it, the number in the TextBox will get formated, once the focus in moved out of the TextBox.