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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent: Simple pronblem with numbers 2

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
 
ja!

Here go! and don't say I never gave you anything
Dim num As Double = CDbl(TextBox1.Text)
Dim mine As String
mine = CStr(num / 10)

If mine.IndexOf(".") = -1 Then
MsgBox(mine & "hurray!")
Else
MsgBox(mine & "BOo")
End If
That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
I've used the MOD function in dot net to do this, e.g.,

If myvalue MOD 10 = 0 Then
'you're there
Else
'you're not there
End If
 
I like Isadore's solution better.
kudos man That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Thanks Zarcom. Let's see, that's the first time in say, 100 posts that I've trumped ya. Gee, made my day. Thanks for all the help Zarcom; no doubt you have made a difference to so many, saving time, etc... Gald you're around bud. Now if I can just man handle my double string problem, I'll be off and running.
 
np bud I enjoy being here. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Picky, picky. Is 0 considered a multiple of 10? How about -20
If MATH.ABS(Myvalue) > 9 andalso myvalue MOD 10 = 0 Then
'you're there
Else
'you're not there
End If Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
D: I'm a part time programmer in a pasta world! Great line of code John, danke!

You guys are too much, great to know ya.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top