一个格式化数字字符串函数
又是剽窃核心编程
// This function accepts a number and converts it to a // string, inserting commas where appropriate. PTSTR BigNumToString(LONG lNum, PTSTR szBuf, DWORD chBufSize) { TCHAR szNum[100]; wsprintf(szNum, TEXT(“%d”), lNum); NUMBERFMT nf; nf.NumDigits = 0; nf.LeadingZero = FALSE; nf.Grouping = 3; nf.lpDecimalSep = TEXT(“.”); nf.lpThousandSep = TEXT(“,”); nf.NegativeOrder = 0; GetNumberFormat(LOCALE_USER_DEFAULT, 0, szNum, &nf, szBuf, chBufSize); return(szBuf); }
感谢您的阅读,本文由 smallwhite's Blog 版权所有。如若转载,请注明出处:smallwhite's Blog(https://smallwhite.ml/pub/uncategorized/yi-ge-ge-shi-hua-shu-zi-zi-fu-chuan-han-shu.html)