Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

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

Results 1 to 2 of 2
Share This Thread →
  1. #1
    lcb
    lcb is offline Registered User
    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
    Indo_fraiser's Avatar
    Indo_fraiser is offline Contributing User
    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

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

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, 08:32 AM
  2. Replies: 1
    Last Post: November 15th, 2006, 05: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, 10: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, 03:13 PM
  5. Replies: 3
    Last Post: November 21st, 2005, 11:19 AM

ASP Free Advertisers and Affiliates