restrict characters in input field

3f”, x would have been printed rounded to 3 decimal places. Sample HTML Code :