#1
  1. No Profile Picture
    lcb
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Mar 2011
    Posts
    1
    Rep Power
    0

    HELP PLEASE, Patient Weight converter I can't it to work


    I am really new at this and I am really stuck could some one please tell me what I am doing wrong. I trying to make a patient converter so a patient can put in their weight and it will convert it from pounds to kilo or kilo to pounds

    this is what I got.
    Dim decWeight As Decimal
    Dim decConvertedWeight As Decimal
    Dim decPounds = decConvertedWeight*2.2
    Dim decKilograms = decConvertedWeight/2.2

    If IsNumeric (txtWeight.Text) Then decWeight = Convert.ToDecimal (txtWeight.Text)

    If decWeight > 500 Then
    radConvertPounds.Checked = (decConvertedWeight = decKilograms)
    Else : radConvertKilograms.Checked = (decPounds = txtWeight.Text)
    End If

    decConvertedWeight = decWeight*decConvertedWeight
    lblConvertedWeight.Text = decConvertedWeight.ToString ("c")

    txtWeight.Text = ""
    txtWeight.Focus()
  2. #2
  3. Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Mar 2009
    Posts
    87
    Rep Power
    8
    Done on the fly but try...

    Code:
    
    Dim decConvertedWeight
    Dim decPounds
    Dim decKilograms
    
    decPounds = (decConvertedWeight * 2.2)
    decKilograms = (decConvertedWeight / 2.2)
    
    If IsNumeric(txtWeight.Text) Then decWeight = Convert.ToDecimal(txtWeight.Text)
    
    If decWeight > 500 Then
    radConvertPounds.Checked = (decConvertedWeight = decKilograms)
    Else
    radConvertKilograms.Checked = (decPounds = txtWeight.Text)
    End If
    
    decConvertedWeight = (decWeight * decConvertedWeight)
    lblConvertedWeight.Text = decConvertedWeight.ToString("c")
    
    txtWeight.Text = ""
    txtWeight.Focus()
    Loves reputation points

Similar Threads

  1. Part of my script doesn't work, please help.
    By Zoe-Alyssa in forum ASP Development
    Replies: 6
    Last Post: December 14th, 2006, 09:32 AM
  2. Replies: 1
    Last Post: November 15th, 2006, 06:06 PM
  3. How to get a function to work when using Option Explicit
    By hauruapai in forum ASP Development
    Replies: 2
    Last Post: April 19th, 2006, 11:23 PM
  4. Does IP or Domain name restriction work under IIS?
    By cybercat in forum Microsoft IIS
    Replies: 1
    Last Post: January 18th, 2006, 04:13 PM
  5. Replies: 3
    Last Post: November 21st, 2005, 12:19 PM

IMN logo majestic logo threadwatch logo seochat tools logo