projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Merge branch 'fio-docs-ci' of https://github.com/vincentkfu/fio
[fio.git]
/
lib
/
num2str.c
diff --git
a/lib/num2str.c
b/lib/num2str.c
index 3597de2f10903b461d890a536b55033ede87237f..cd89a0e59171291017ece4429bc70b4e43eb95ca 100644
(file)
--- a/
lib/num2str.c
+++ b/
lib/num2str.c
@@
-110,6
+110,9
@@
done:
sprintf(tmp, "%.*f", (int)(maxlen - strlen(tmp) - 1),
(double)modulo / (double)thousand);
+ if (tmp[0] == '1')
+ num++;
+
if (asprintf(&buf, "%llu.%s%s%s", (unsigned long long) num, &tmp[2],
unitprefix[post_index], unitstr[units]) < 0)
buf = NULL;