这是我写的一段
amount=Convert.ToDecimal((dv_grid.Rows[i].Cells["pro_amount"].Value == null ? "0" : dv_grid.Rows[i].Cells["pro_amount"].Value.ToString());如果pro_amount为NULL,则amount值为“0”,否则为dv_grid.Rows[i].Cells["pro_amount"].Value.ToString()).现在我要想实现:
如果pro_amount为NULL或为“”,则amount值为“0”,否则为dv_grid.Rows[i].Cells["pro_amount"].Value.ToString()),
amount=Convert.ToDecimal((dv_grid.Rows[i].Cells["pro_amount"].Value == null ? "0" : dv_grid.Rows[i].Cells["pro_amount"].Value.ToString());如果pro_amount为NULL,则amount值为“0”,否则为dv_grid.Rows[i].Cells["pro_amount"].Value.ToString()).现在我要想实现:
如果pro_amount为NULL或为“”,则amount值为“0”,否则为dv_grid.Rows[i].Cells["pro_amount"].Value.ToString()),
amount=Convert.ToDecimal( string.isNullorEmpty(value) ? "0" : value);