fix rounding issues in %f format
Igor Sysoev
12 years ago
385 | 385 | * (int64_t) cast is required for msvc6: |
386 | 386 | * it can not convert uint64_t to double |
387 | 387 | */ |
388 | ui64 = (uint64_t) ((f - (int64_t) ui64) * scale); | |
388 | ui64 = (uint64_t) ((f - (int64_t) ui64) * scale + 0.5); | |
389 | 389 | |
390 | 390 | buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width); |
391 | 391 | } |