iio:magnetometer:mag3110: Fix output of decimal digits in show_int_plus_micros()
authorPeter Meerwald <pmeerw@pmeerw.net>
Wed, 1 Oct 2014 20:59:00 +0000 (21:59 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sat, 8 Feb 2014 10:06:27 +0000 (10:06 +0000)
need to print leading zeros, hence "%d.%06d"

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/magnetometer/mag3110.c

index b88cb44f87ce6c205addbac271404b0340f70bc6..f66955fb3509e261f3a0d0cf7028f6178b3cb1a2 100644 (file)
@@ -106,7 +106,7 @@ static ssize_t mag3110_show_int_plus_micros(char *buf,
 
        while (n-- > 0)
                len += scnprintf(buf + len, PAGE_SIZE - len,
-                       "%d.%d ", vals[n][0], vals[n][1]);
+                       "%d.%06d ", vals[n][0], vals[n][1]);
 
        /* replace trailing space by newline */
        buf[len - 1] = '\n';