-
Noob question
really simple question
Is there anyway to overload the return value as I have tried to do below
class currency
{
private Int64 Total;
public Int64 currency
{
get
{
return (Total / 1000);
}
set
{
Total = (value * 1000);
}
}
public Int32 currency
{
get
{
return (Int32)(Total / 1000);
}
set
{
Total = (Int64)(value * 1000);
}
}
Thanks
-
Re: Noob question
No, though you could wrap the int in your own class and use polymorphism.
Also, you are doing integer division which is sure to cause problems soon. Currency should be handled using the decimal type.