티스토리 뷰

반응형

 

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 

namespace ConsoleApp1 
{ 
    class Program 
    { 
        static void Main(string[] args) 
        { 
            int Num = 123456; 
            String strPrint; 

            strPrint = String.Format("일반 포맷 : {0}", Num); 
            Console.WriteLine(strPrint); 

            strPrint = String.Format("우측 정렬 : {0, 10}", Num); 
            Console.WriteLine(strPrint); 

            strPrint = String.Format("좌측 정렬 : {0, -10}", Num); 
            Console.WriteLine(strPrint); 

            strPrint = String.Format("좌측 정렬 및 콤마 표시 : {0, -20:N0}", Num); 
            Console.WriteLine(strPrint); 

            strPrint = String.Format("우측 정렬 및 콤마 표시 : {0, 20:N0}", Num); 
            Console.WriteLine(strPrint); 
             
            Console.WriteLine(""); 
        } 
    } 
}

결과

 

반응형

'프로그래밍 > Visual C#' 카테고리의 다른 글

CheckListBox  (0) 2020.01.10
CheckBox  (0) 2020.01.10
MS-SQL DB 연결  (0) 2020.01.02
MessageBox (메시지 박스)  (0) 2020.01.02
모달리스 폼 띄우기  (0) 2019.12.30
댓글
반응형
최근에 올라온 글
Total
Today
Yesterday