Please Enable JavaScript!
Mohon Aktifkan Javascript![ Enable JavaScript ]

[C#_source] 숫자 3자리 마다 (,) 콤마

2016. 4. 19. 15:19Source/C#_source

728x90


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


출처 :

http://ramses8.tistory.com/397

728x90

'Source > C#_source' 카테고리의 다른 글

[C#_source] 날짜와 시간 따로 구해서 더하기  (0) 2016.04.19