/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/***********************************************************
* Function File: itoa.c
*
* Note: (1)  ANSI C function in standard lib stdlib.h
*       (2)  change int to string
**********************************************************/
char *itoa(int value, char *str, int radix)
{
  if(radix == 2) {
/* to be tested 
     sprintf(str, "%b", value);
*/
     str[0] = '\0';
  }
  else if(radix == 8) {
     sprintf(str, "%o", value);
  }
  else if(radix == 10) {
     sprintf(str, "%d", value);
  }
  else if(radix == 16) {
     sprintf(str, "%x", value);
  }
  return str;
}
