[C#] 숫자 3자리 마자 콤마 찍기

int won = 123456890;
 
Console.WriteLine(string.Format("{0:n0}", won));
Console.WriteLine(string.Format("{0}", won.ToString("n0"))); ;
Console.WriteLine(string.Format("{0:#,##0}", won));
Console.WriteLine(string.Format("{0}", won.ToString("#,##0")));
 
//결과
//123,456,890
//123,456,890
//123,456,890
//123,456,890
이전글
다음글

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다