examples/hdc1008_demo: fix formatting after decimal point

Modulo operation used to calculate digits after decimal point,
but if that result is <10, a leading zero wasn't added, giving a
wrong value.

Same as 34c7bec0dc
but on the example app.
This commit is contained in:
Diego Herranz 2021-12-13 19:31:24 +01:00 committed by Xiang Xiao
parent 1e28c3b9ea
commit 7ba6f7cdb3

View File

@ -99,7 +99,7 @@ int main(int argc, FAR char *argv[])
printf("Temperature and humidity (ioctl)\n"
"================================\n");
printf("t=%d.%d, h=%d.%d\n\n",
printf("t=%d.%02d, h=%d.%d\n\n",
data.temperature / 100, data.temperature % 100,
data.humidity / 10, data.humidity % 10);