Seeed TFT - Convert temp to a string that is suitable for tft.drawString

I'm confused on how to convert the float of celsius to a string so that the tft.drawstring doesn't throw an error. I've searched around quite a bit, and have seen similar examples, but not for the Seeed brand TFT v1 LCD. Below is a snippet of code that I have


int rawvoltage= analogRead(outputpin); float millivolts= (rawvoltage/1024.0) * 5000; float celsius= millivolts/10; Serial.print(celsius); Serial.print(" degrees Celsius, ");

Serial.print((celsius * 9)/5 + 32); Serial.println(" degrees Fahrenheit");

float temperature = ((celsius * 9)/5 + 32);

Tft.drawString("Temp:",90,300,2,BLUE); Tft.drawString(temperature,90,130,2,GREEN); //////////////////////////////////////////////////////////

The error that I get what do that is the following:

_16_Channel_Relay.ino: In function 'void loop()': _16_Channel_Relay:201: error: no matching function for call to 'TFT::drawString(float&, int, int, int, int)' C:\Program Files\Arduino\libraries\TFT/TFT.h:172: note: candidates are: void TFT::drawString(char*, unsigned int, unsigned int, unsigned int, unsigned int)

how about multiplying by 100 to move the 2 places to the left of the decimalto the right and create an integer 100 x the magnitude of your reading, use the itoa() int to ascii to create a char array.

then move to an array of 6 characters long so you can insert a decimal and terminate with a null turning it into a string?

something likeā€¦

int bigFloat = int(myfloat x 100);
char buf[4]; 
char mystring[6];

itoa(bigFloat, buf,4);

mystring[0] = buf[0];
mystring[1] = buf[1];
mystring[2] = '.';
mystring[3] = buf[2];
mystring[4] = buf[3];
mystring[5] = '/0';

Or, you can simply use dtostrf