Losing values to the right of the decimal point

Hi, I am a programming novice, I'm trying to convert a FLOAT to an INT for transmission over wireless, then want to convert the INT back to the original FLOAT value. I thought this would work:

float temp = 23.54;
int int_temp = (temp * 100);
float converted_temp= int_temp / 100;

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
Serial.print("temp: "); Serial.print(temp);
Serial.print("\nmultiplied: "); Serial.print(int_temp);
Serial.print("\nconverted: "); Serial.println(converted_temp);
}

void loop() {
  // put your main code here, to run repeatedly:

}

... but I get the following output, note the loss of information to the right of the decimal point:

temp: 23.54
multiplied: 2354
converted: 23.[color=limegreen]00[/color]

I'm sure its an easy one but I can't find a solution.

Thanks

Jon
float converted_temp= int_temp / 100;

If you divide an int (int_temp) by an int (100) you get an integer result, even if you later store it in a float. Change "100" to "100.0" (a float) to get a float result.

Perfect, thanks very much !

If you just want to print with nothing to the right of the decimal, print the float with zero places, Serial.print(floatVar, 0).