This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 7ba6f7c  examples/hdc1008_demo: fix formatting after decimal point
7ba6f7c is described below

commit 7ba6f7cdb3b524c5ceec4fd412cfb0f97a0f11fb
Author: Diego Herranz <[email protected]>
AuthorDate: Mon Dec 13 19:31:24 2021 +0100

    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 
https://github.com/apache/incubator-nuttx/commit/34c7bec0dc644ba3bab9f0ffa91de9dafd44b37d
    but on the example app.
---
 examples/hdc1008_demo/hdc1008_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/hdc1008_demo/hdc1008_main.c 
b/examples/hdc1008_demo/hdc1008_main.c
index f34daf3..cf5c558 100644
--- a/examples/hdc1008_demo/hdc1008_main.c
+++ b/examples/hdc1008_demo/hdc1008_main.c
@@ -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);
 

Reply via email to