meaning

  • Thread starter Thread starter vinnie
  • Start date Start date
V

vinnie

Does this mean Convert?

double Amout = 123;

decimal value = (decimal)Amount;


What will be value after that? 123?
Thanks
 
vinnie said:
Does this mean Convert?

double Amout = 123;

decimal value = (decimal)Amount;


What will be value after that? 123?
Thanks

123 stored as a decimal, which is not the same way a double is stored.
 
Hi vinnie,

That means casting, with decimal result 123.
Convert it's a System.Convert

Regards, Alex
[TechBlog] http://devkids.blogspot.com



v> Does this mean Convert?
v>
v> double Amout = 123;
v>
v> decimal value = (decimal)Amount;
v>
v> What will be value after that? 123?
v> Thanks
 
Hi,

vinnie said:
Does this mean Convert?

Not really, you are converting it but the name of the mechanism is casting.
So you are doing a cast, It's not the same that using one of the
Convert.ToXXXX methods

I do remember a thread a few days ago regarding cast/Convert take a look in
the archives for some interesting threads about the subject.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top