, , :
(100 ), ( ), , , .
.net :
object o="string";
string s=(string) o
, "", .
,
double d= 3.7;
long l = (long) x;
I actually change the nature of things, dand ldo not have the same representation, one is a double-wide floating point with a value of 3.7, and the other is a 64-bit integer with a value of 3.
The .net statement can do both of these things, however it won’t do them at the same time, and that’s where your problem was ...
decimal d=4m;
object o = d;
long l1 = (long)o;
long l2 = (decimal)o;
long l3 = (long)(decimal)o;
BTW, a shameless copy of the wizard ( here for more detailed explanations )
Sweko source
share