diff options
author | Igor Sysoev <igor@sysoev.ru> | 2010-05-12 17:13:11 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2010-05-12 17:13:11 +0400 |
commit | 50af4061443a01c788c0ecb7dc1e45d2e55b4a43 (patch) | |
tree | 95303d6feb33a885b6afd19bf211b576d3012e02 /src/core/ngx_string.c | |
parent | 503b9716c5ebf3e8870b5560220341b5ad480734 (diff) |
fix rounding issues in %f format
Diffstat (limited to 'src/core/ngx_string.c')
-rw-r--r-- | src/core/ngx_string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c index ce1fad65c..5cf505aa1 100644 --- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c @@ -386,7 +386,7 @@ ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args) * (int64_t) cast is required for msvc6: * it can not convert uint64_t to double */ - ui64 = (uint64_t) ((f - (int64_t) ui64) * scale); + ui64 = (uint64_t) ((f - (int64_t) ui64) * scale + 0.5); buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width); } |