void txDecimalCounter::appendNumber(PRInt32 aNumber, String& aDest)
void txDecimalCounter::appendNumber(PRInt32 aNumber, nsAString& aDest)
void txDecimalCounter::appendNumber(PRInt32 aNumber, String& aDest){    const PRInt32 bufsize = 10; //must be able to fit an PRInt32    PRUnichar buf[bufsize];    PRInt32 pos = bufsize;    while (aNumber > 0) {        PRInt32 ch = aNumber % 10;        aNumber /= 10;        buf[--pos] = ch + '0';    }    // in case we didn't get a long enough string    PRInt32 end  = (bufsize > mMinLength) ? bufsize - mMinLength : 0;    while (pos > end) {        buf[--pos] = '0';    }        // in case we *still* didn't get a long enough string.    // this should be very rare since it only happens if mMinLength is bigger    // then the length of any PRInt32.    // pos will always be zero     PRInt32 extraPos = mMinLength;    while (extraPos > bufsize) {        aDest.Append(PRUnichar('0'));        --extraPos;        if (extraPos % mGroupSize == 0) {            aDest.Append(mGroupSeparator);        }    }    // copy string to buffer    if (mGroupSize >= bufsize - pos) {        // no grouping will occur        aDest.Append(buf + pos, (PRUint32)(bufsize - pos));    }    else {        // append chars up to first grouping separator        PRInt32 len = ((bufsize - pos - 1) % mGroupSize) + 1;        aDest.Append(buf + pos, len);        pos += len;        while (bufsize - pos > 0) {            aDest.Append(mGroupSeparator);            aDest.Append(buf + pos, mGroupSize);            pos += mGroupSize;        }        NS_ASSERTION(bufsize == pos, "error while grouping");    }}