Home All Groups Group Topic Archive Search About

Help with vb.net Maths syntax in asp.net

Author
25 Oct 2007 8:45 AM
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

Author
25 Oct 2007 8:15 PM
Phil H
On 25 Oct, 09:45, "Jamie Sutherland"
<ja...@n0spam.sutherlandwest.plus.com> wrote:
Show quoteHide quote
> 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