Convert integer to decimal in vb.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karthickbabu
    New Member
    • Sep 2007
    • 33

    Convert integer to decimal in vb.net

    Hi

    In my application i want to convert integer to decimal. I get a input and using convert function to convert into decimal. But it shows as it self. My code like as below, Is any wrong in my code

    dim input as long // I declare as long
    dim decimaloutput as decimal

    decimaloutput = Convert.ToDecim al(input)
    label1.text = decimaloutput.T oString()


    Sample output : 24

    Decimal of 24 is 24

    Is it correct or How can it display the output


    Hope your reply
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    Hi that is the correct way to convert it to a decimal.
    Were you expecting something else to be printed out?

    Comment

    • karthickbabu
      New Member
      • Sep 2007
      • 33

      #3
      Hi Sorry little bit i confused. Then sit back and think My output is correct

      Thanks for your reply

      Originally posted by Shashi Sadasivan
      Hi that is the correct way to convert it to a decimal.
      Were you expecting something else to be printed out?

      Comment

      Working...