Wire.Write "bytes as string"

Hoi friends,
i am using 2 MEGAs connected via I2C.
Slave collects datas from sensors and send them to the Master.
The datas send are byte and i cant print it directly on the TFT.

float t;
float h;
...


   // DISPLAY DATA
  Serial.println("");
  Serial.print("S#2hum");
  Serial.println(DHT.humidity, 2);
  h = (DHT.humidity, 2);
 //   Wire.write(dec_str(h));
  //Serial.print(",\t");
  Serial.print("S#2temp");
  Serial.println(DHT.temperature, 2);
  t = (DHT.temperature, 1);
 // Wire.write(dec_str(t));
  delay(2000);
}

char* dec_str(float value)
{
   char str[33];
   itoa(value,str,10);
   strcat(str,".");
   int dec = 0.5 + 100 * abs(value - (int)value);
   if(dec<10) strcat(str,"0");
   itoa(dec,&str[strlen(str)],10);
   return str;
}

The shown dec_str function return only 2.00 instead of 21.50 i.e.

Where is my fault ?

  h = (DHT.humidity, 2);

What is this crap? Why are you abusing the comma operator that way?

Means 2 decimal places

Means 2 decimal places

In your dreams, maybe.

Serial.print(someCrap, 2); does NOT make someCrap into some magic new value. It invokes a function (print()) that is defined in a class (HardwareSerial, that Serial is an instance of) that performs some specific action.

You can't remove the instance name and the function call and expect the same action.

In your dreams, maybe.

In MY dreams i'll find a forum where a question of mine was answered and where a respectful tone prevails. Its fine that you knwo all answers and MAYBE you got it all in one.

Hard to believe, but some people have to learn some things that had to be declared

Humor me, before you go off in a huff. Look at the documentation for the humidity member of the DHT class. Change the type of h to match the type of humidity. Loose the parentheses and the ,2.

   float h = DHT.humidity;

Now, call your function with h, which is now a float, as the function suggests it deals with, AND contains a value like 21.50, not the value 2 which is what the comma operator returned, to be assigned to h, and not 21 which is what would be stored in an int.