mirror of
https://github.com/nginx/nginx.git
synced 2024-12-04 13:59:00 +08:00
fix rounding issues in %f format
This commit is contained in:
parent
503b9716c5
commit
50af406144
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user