In a web page I have many textboxes which from server may have value in int or float format.
Requirement is to check values in client side before page load and if any textbox has float or decimal values (for example 1.00 or 1.67) round values to downward to nearest integer in textboxes.
Please guide me how to do this. I understand it a little that it will need to be done on page load or document ready event of jquery and will need to use Regex but don’t know how to write this syntex. Help me please
DEMO: http://jsfiddle.net/sCQc3/
Using JavaScript’s
floor()method (W3Schools), you can round down a number to the closest integer.