Help with vb.net Maths syntax in asp.net

Discussion in 'ASP .Net Web Controls' started by Jamie Sutherland, Oct 25, 2007.

  1. 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
     
    Jamie Sutherland, Oct 25, 2007
    #1
    1. Advertising

  2. Jamie Sutherland

    Phil H Guest

    On 25 Oct, 09:45, "Jamie Sutherland"
    <> wrote:
    > 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
     
    Phil H, Oct 25, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ross Clement (Email address invalid - do not use)

    Maths expression drawing library

    Ross Clement (Email address invalid - do not use), Jan 11, 2006, in forum: Java
    Replies:
    4
    Views:
    604
    Vyacheslav Levitsky
    Oct 2, 2006
  2. Calum Maciver

    Maths Involved

    Calum Maciver, Feb 18, 2006, in forum: Java
    Replies:
    5
    Views:
    461
    Luke Webber
    Feb 19, 2006
  3. Andrew Bullock

    bit of a maths quesiton

    Andrew Bullock, Feb 5, 2005, in forum: C++
    Replies:
    2
    Views:
    309
    Victor Bazarov
    Feb 5, 2005
  4. Geoff

    Maths in HTML

    Geoff, Jan 4, 2007, in forum: HTML
    Replies:
    10
    Views:
    720
    Adrienne Boswell
    Jan 6, 2007
  5. Rory Campbell-Lange

    Maths error

    Rory Campbell-Lange, Jan 8, 2007, in forum: Python
    Replies:
    36
    Views:
    999
    Nick Maclaren
    Jan 16, 2007
Loading...

Share This Page