이가을에 동유.. | 롤롤
http://blog.naver.com/lollol1246/100010946141
http://blog.naver.com/lollol1246/100010946141
1000000 -> 1,000,000식으로 변환해주는 함수
GetNumberFormat
The GetNumberFormat function formats a number string as a number string customized for a specified locale.int GetNumberFormat(
LCID Locale, // locale for which string is to be formatted
DWORD dwFlags, // bit flag that controls the function's operation
LPCTSTR lpValue, // pointer to input number string
CONST NUMBERFMT *lpFormat, // pointer to a formatting information structure
LPTSTR lpNumberStr, // pointer to output buffer
int cchNumber // size of output buffer
);
static NUMBERFMT nFmt = { 0, 0, 3, ",", ".", 0 };
CString CMainFrame::GetNumberFormatFileSize(int nFileSize)
{
TCHAR szVal[32];
TCHAR szOut[32];
CString strReturn = _T("");
wsprintf ( szVal,"%d",nFileSize/1000 );
GetNumberFormat ( NULL, NULL, szVal, &nFmt, szOut, 32 );
strReturn.Format ( "%sKB", szOut);
return strReturn;
}
댓글
댓글 쓰기