Dev./ C# [C#] 정수형 숫자 세자리 마다 콤마(,) 표시하는 방법 동동. 2014. 9. 21. 21:55 값이 0인경우 Null 출력 하기 String.Format("{0:##,##}" 변수명); int total_cost = 12140104; int total_money_cost = 8278383; int total_card_cost = -7215663; int total_point_cost = 12280; string output = null; output = "<div class='summary_boxer-row'>"; output += "<div class='summary_boxer-box'>" + "<span>" + dsResult.Tables[0].Select().Length + "</span>" + "</div>"; output += "<div class='summary_boxer-box'>" + "<span>" + String.Format("{0:##,##}", total_money_cost) + "</span>" + "</div>"; output += "<div class='summary_boxer-box'>" + "<span>" + String.Format("{0:##,##}", total_card_cost) + "</span>" + "</div>"; output += "<div class='summary_boxer-box'>" + "<span>" + String.Format("{0:##,##}", total_cost) + "</span>" + "</div>"; output += "<div class='summary_boxer-box'>" + "<span>" + String.Format("{0:##,##}", total_point_cost) + "</span>" + "</div>"; output += "</div>"; ltl_summary.Text = output; 값이 0인경우 0 출력하기 String.Format("{0:##,##0}" 변수명); int total_cost = 12140104; int total_money_cost = 8278383; int total_card_cost = -7215663; int total_point_cost = 12280; string output = null; output = "<div class='summary_boxer-row'>"; output += "<div class='summary_boxer-box'>" + "<span>" + dsResult.Tables[0].Select().Length + "</span>" + "</div>"; output += "<div class='summary_boxer-box'>" + "<span>" + String.Format("{0:##,##0}", total_money_cost) + "</span>" + "</div>"; output += "<div class='summary_boxer-box'>" + "<span>" + String.Format("{0:##,##0}", total_card_cost) + "</span>" + "</div>"; output += "<div class='summary_boxer-box'>" + "<span>" + String.Format("{0:##,##0}", total_cost) + "</span>" + "</div>"; output += "<div class='summary_boxer-box'>" + "<span>" + String.Format("{0:##,##0}", total_point_cost) + "</span>" + "</div>"; output += "</div>"; ltl_summary.Text = output; 반응형 공유하기 게시글 관리 공대생의 코딩 정복기 #2 저작자표시 비영리 변경금지