Code:
void changecolor(char* word, int color){
	int index = word.find(word, ".") ;

	if (index != -1){
		index += 3;
		
		if (word[index] >= '5'){
			index--;
			word[index]++;
			index++;
		}
		
		word[index] = '\0';
		
	}
	
	textcolor(color); 		 //changes text to the color given through the argument
	cprintf("%s\n", word);	     	  //outputs the string in the given color
	textcolor(LIGHTGRAY);	 //change color back to the default light gray
} //end void changecolor
like so?