[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 504
  • Last Modified:

validate integer and decimal

Hi experts
Could someone show me how to validate a number in a textbox to ensure that it is either an integer, or a decimal number with 2 places to the right of the decimal point.
0
dizzycat
Asked:
dizzycat
1 Solution
 
rajvjaCommented:
if isnumeric(txt1.value) then
'its a number
  if indexOf(txt1.value,'.') > 0 then
     if txt1.value.substring(indexOf(txt1.value,'.')+1,len(txt1.value)-indexOf(txt1.value,'.')).length =2 then
       'number with 2 decimal places
     end if
  end if
end if
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now