Hi Thanks for Reply,
I got the way to do this which is simpler I am posting
java script here so if anyone else require this can use easily.
//this function will restrict user to enter values upto two decimal point only
function validDecimal(str){
if (str.indexOf('.') == -1) str += ".";
var decNum = str.substring(str.indexOf('.')+1, str.length);
if (decNum.length > 2)//here is the key u can just change from 2 to 3,45 etc to restict no of digits aftre decimal
{
alert("Invalid more than 2 digits after decimal")
}
else {
alert("Valid no")
}
}