mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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:
parent
1e28c3b9ea
commit
7ba6f7cdb3
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue