output 100 as 0.1

Hi to all,

new in programming:

how to print on the screen the number 100 as 0.1 ? [for e.g. the 100 (meters) to appear as 0.1 (km)]

Divide by 1000.

Make sure that "100" is a floating point value.

Integer division, like in the following, results in zero.

int x=100;
Serial.println(x/1000);
int x=100;
Serial.println(x/1000.0, 1);

thank you all.

Dear sirs,

the code:
int x=100;
Serial.println(x/1000.0, 1);

works just fine for me.

I have one extra question: how do I output 100 as 0.10 or better 0.100 (trailing zeros is the term) ?