Does this mean Convert?
double Amout = 123;
decimal value = (decimal)Amount;
What will be value after that? 123?
Thanks
PvdG42 - 11 Sep 2007 15:27 GMT
> Does this mean Convert?
>
[quoted text clipped - 4 lines]
> What will be value after that? 123?
> Thanks
123 stored as a decimal, which is not the same way a double is stored.
Alex Meleta - 11 Sep 2007 15:33 GMT
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
Ignacio Machin ( .NET/ C# MVP ) - 11 Sep 2007 15:36 GMT
Hi,
> 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.