C#

c# 숫자에 , (콤마) 찍기

데굴데구르르 림 2019. 6. 26. 14:18
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