Help with vb.net Maths syntax in asp.net

J

Jamie Sutherland

Hi,
I am trying to get my web app to do some maths...
The user enters a number in a textbox, then i want the app to deduct 2 from
every multiple of 12.
ie
12 =10
24 =20
36 =30
48 =40

and so on

Any one got any ideas on how i can do this?

Thanks in advance
Jamie
 
P

Phil H

Hi,
I am trying to get my web app to do some maths...
The user enters a number in a textbox, then i want the app to deduct 2 from
every multiple of 12.
ie
12 =10
24 =20
36 =30
48 =40

and so on

Any one got any ideas on how i can do this?

Thanks in advance
Jamie

Hi Jamie

How about:

Dim x as integer = ATextBox.text

if (x mod 12) = 0 then x -= 2

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top