Format.cpp.patch
Format.cpp (working copy) | ||
---|---|---|
84 | 84 | |
85 | 85 |
String FormatIntAlpha(int i, bool upper) |
86 | 86 |
{ |
87 |
const char *itoc = upper ? "ZABCDEFGHIJKLMNOPQRSTUVWXYZ" : "zabcdefghijklmnopqrstuvwxyz"; |
|
87 | 88 |
if(IsNull(i) || i == 0) |
88 | 89 |
return Null; |
89 | 90 |
String out; |
... | ... | |
93 | 94 |
i = -i; |
94 | 95 |
} |
95 | 96 |
char temp[10], *p = temp; |
96 |
i--; |
|
97 |
char start = (upper ? 'A' : 'a'); |
|
98 | 97 |
do |
99 |
*p++ = start + (i % 26);
|
|
98 |
*p++ = itoc[i--%26];
|
|
100 | 99 |
while(i /= 26); |
101 | 100 |
while(p > temp) |
102 | 101 |
out << *--p; |