sprintf might do the job, or itoa, depending on exactly how you want to do it.