string fds = "59999996";
if (fds.Length > 3)
{
string temp = fds;
string[] b = new string[temp.Length / 3 + 1];
for (int i = 0; i < b.Length; i++)
{
if (temp.Length >= 3)
{
b[i] = temp.Substring(temp.Length - 3);
temp = temp.Remove(temp.Length - 3);
string fdsa = b[i]+",";
TextBox3.Text = temp;
}
else { b[i] = temp.Substring(0); }
}
}
else
{
TextBox3.Text = fds;
}
自己再小改下吧,经理 来了哈 。
string str="99999999";
str.ToString("#,#");
这样就可以将数字字符串按千分位分隔了
“99999999”.ToString("N").Replace(".00","");