By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,615 Members | 1,961 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,615 IT Pros & Developers. It's quick & easy.

Convert integer to decimal in vb.net

karthickbabu
P: 33
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.ToDecimal(input)
label1.text = decimaloutput.ToString()


Sample output : 24

Decimal of 24 is 24

Is it correct or How can it display the output


Hope your reply
Nov 23 '07 #1
Share this Question
Share on Google+
2 Replies


Shashi Sadasivan
Expert 100+
P: 1,435
Hi that is the correct way to convert it to a decimal.
Were you expecting something else to be printed out?
Nov 23 '07 #2

karthickbabu
P: 33
Hi Sorry little bit i confused. Then sit back and think My output is correct

Thanks for your reply

Hi that is the correct way to convert it to a decimal.
Were you expecting something else to be printed out?
Nov 26 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.