Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT: Simple Question about testing for integer

Status
Not open for further replies.

swiv

Programmer
Sep 18, 2002
20
GB
PLease please help

We need to check whether a variable has a value which is a multiple of 10. Sounds simple but can't think of a solution.Please can anyone help me....

swiv

 
How about a little modulo arithmetic?
if isnumeric(testval) then
if (testval \ 10) * 10 = testval then
test passes
else
test fails
end if
else
test fails
end if
 

Why not just use the mod operator/function?
?101 mod 10
1
?50 mod 10
0
?9 mod 10
9

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top