Reputation: 10575
How to make the Textbox field accept only Decimal Values
Upvotes: 1
Views: 2678
Reputation: 1325
Try this:
function is_int(test)
typeof (a = (typeof test == "function" ? test() : test)) == "number" ? !(a % 1) : false;
returns:
is_int(8) // true
is_int("8") // false
function test() {
return 12
}
is_int(test()) // true
Upvotes: 0