【发布时间】:2016-12-11 01:03:54
【问题描述】:
所以 guyz ,我使用经典的 StringBuilder 创建一些文本,以便我可以将其“附加”到文本文件中。 一切正常,但我需要文本文件具有特定外观,所以我需要将价格(例如 32)显示为(00032.0000)。 为了让“32”出现在 TxT 文件中,我使用了这段代码。
calcprice = Convert.ToInt32(printquant) * Convert.ToInt32(dataGridView2.Rows[counter4].Cells[category].Value);
printprice = calcprice.ToString();
csvcontent.AppendLine(printprice);
【问题讨论】:
-
调查 string.Format.
-
可能是 AppendFormat ?
-
是的,你的情况可能更好。忘记那个了。