3
我在Winforms上使用Datagidview控件。這是動態填充。我想在網格中顯示4位小數格式數字。我將DefaultCellStyle屬性應用爲;
DataGridView:使用小數的DefaultCellStyle
dataGridViewCellStyle2.Format = "N4";
dataGridView1.DefaultCellStyle= dataGridViewCellStyle2;
當我輸入的數據爲21.2134它顯示正確。但是當我輸入一個像20的完整數字時,它顯示我的數字爲20.0000。我想擺脫那些尾隨的0。 編輯:
剛剛遇到的另一個問題。用這段代碼它接受數據爲21.2100。
請幫我解決這個問題。
在此先感謝。
維傑