Commit 1002c6da authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

src: Use llround instead of round

parent 09113376
...@@ -1103,8 +1103,9 @@ std::string format_duration(double t) { ...@@ -1103,8 +1103,9 @@ std::string format_duration(double t) {
} }
std::string dtos(double n) { std::string dtos(double n) {
auto f = utos(static_cast<int64_t>(round(100. * n)) % 100); auto m = llround(100. * n);
return utos(static_cast<int64_t>(n)) + "." + (f.size() == 1 ? "0" : "") + f; auto f = utos(m % 100);
return utos(m / 100) + "." + (f.size() == 1 ? "0" : "") + f;
} }
StringRef make_http_hostport(BlockAllocator &balloc, const StringRef &host, StringRef make_http_hostport(BlockAllocator &balloc, const StringRef &host,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment