View Single Post
  #2 (permalink)  
Old February 21st, 2004, 05:15 AM
Gert Gert is offline
Authorized User
Join Date: Jun 2003
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts

Hi. I use the following code to do this in Visual C++. Maybe you can use it. I am sure there are better ways to do this, but it works for my purposes. (It is not my code, but you may use it...)

CString CYourClass::IntToString(int number)
    int i=0;
    int antdes=0;    // = number of digits
    CString temp;
    BOOL negsign=FALSE;


    else if(number>999999999999999999)
    else if(number>99999999999999999)
    else if(number>9999999999999999)
    else if(number>999999999999999)
    else if(number>99999999999999)
    else if(number>9999999999999)
    else if(number>999999999999)
    else if(number>99999999999)
    else if(number>9999999999)
    else if(number>999999999)
    else if(number>99999999)
    else if(number>9999999)
    else if(number>999999)
    else if(number>99999)
    else if(number>9999)
    else if(number>999)
    else if(number>99)
    else if(number>9)
    return temp;
Reply With Quote