Really?
Why did you convert these from VB without knowing what you were doing?
Let's look at some of this, shall we?
public object n2s(float w, int n)
{
string Ret_Val = null;
Ret_Val = "0000000000" + w;
Ret_Val = Ret_Val.Substring(Strings.Len(Ret_Val) - n, n);
return Ret_Val;
}
1) Why does it return an
object
when it clearly should return a
string
?
2) Why are you converting to a fixed number of digits without checking if the number is actually larger or smaller than that number of digits? Or includes an exponent?
3) Why do you try to access Linq at all?
4) Why not just use .NET string formatting? If you look here
http://msdn.microsoft.com/en-us/library/dd260048(v=vs.110).aspx[
^] it shows you how to do it properly...
You can't just pick up old (pretty rubbish) VB6 code, and expect an online translator to turn it into good quality modern C# - it isn't going to happen.