I have the below function
public object Convert(object value)
{
string retVal = string.Empty;
int oneMillion = 1000000;
retVal = ((double)value / oneMillion).ToString("###,###,###.###");
return retVal;
}
I am invoking like
var result = Convert(107284403940);
Error: "Specified cast is not valid."
how to fix...
Note:~ the object value can be double, decimal, float, integer(32 and 64)..anything
Is it possible to do the typecasting at runtime?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…