mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:56:26 +00:00
Reuse existing function instead of duplicating functionality
Patch by Carlo Bramini, carlo dot bramix at libero dot it See issue #2437 for more details. svn path=/trunk/; revision=33468
This commit is contained in:
parent
a617fe3890
commit
7c21013a99
1 changed files with 4 additions and 25 deletions
|
@ -24,32 +24,11 @@
|
||||||
static INT
|
static INT
|
||||||
ConvertDWord (DWORD num, LPTSTR des, INT len, BOOL bSeparator)
|
ConvertDWord (DWORD num, LPTSTR des, INT len, BOOL bSeparator)
|
||||||
{
|
{
|
||||||
TCHAR temp[32];
|
ULARGE_INTEGER ui;
|
||||||
INT c = 0;
|
|
||||||
INT n = 0;
|
|
||||||
|
|
||||||
if (num == 0)
|
ui.u.LowPart = num;
|
||||||
{
|
ui.u.HighPart = 0;
|
||||||
des[0] = _T('0');
|
return ConvertULargeInteger(ui, des, len, bSeparator);
|
||||||
des[1] = _T('\0');
|
|
||||||
n = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
temp[31] = 0;
|
|
||||||
while (num > 0)
|
|
||||||
{
|
|
||||||
if (bSeparator && (((c + 1) % (nNumberGroups + 1)) == 0))
|
|
||||||
temp[30 - c++] = cThousandSeparator;
|
|
||||||
temp[30 - c++] = (TCHAR)(num % 10) + _T('0');
|
|
||||||
num /= 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (n = 0; n <= c; n++)
|
|
||||||
des[n] = temp[31 - c + n];
|
|
||||||
}
|
|
||||||
|
|
||||||
return n;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue