mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
Core: FormatIntAlpha fixed (thanks omari)
git-svn-id: svn://ultimatepp.org/upp/trunk@11889 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
584406dcf2
commit
d13cf462b4
1 changed files with 4 additions and 6 deletions
|
|
@ -92,14 +92,12 @@ String FormatIntAlpha(int i, bool upper)
|
|||
out << '-';
|
||||
i = -i;
|
||||
}
|
||||
char temp[10], *p = temp;
|
||||
i--;
|
||||
char start = (upper ? 'A' : 'a');
|
||||
char temp[10], *p = temp + 10;
|
||||
const char *itoc = upper ? "ZABCDEFGHIJKLMNOPQRSTUVWXYZ" : "zabcdefghijklmnopqrstuvwxyz";
|
||||
do
|
||||
*p++ = start + (i % 26);
|
||||
*--p = itoc[i-- % 26];
|
||||
while(i /= 26);
|
||||
while(p > temp)
|
||||
out << *--p;
|
||||
out.Cat(p, temp + 10);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue