Adjust column widths

This commit is contained in:
Eric Harding committed 2018-11-08 13:33:23 -05:00
1 parent 4d993f2ef7
commit de83f19388
1 file changed
+5 -5
+5 -5
View File
@@ -43,21 +43,21 @@ std::string print_book(
ss << "TRead: " << tread.to_uint64() << " ns" << std::endl;
char buffer[512];
snprintf(buffer, 512, "%-4s %-10s | %-10s %-4s\n", "sz", "bid", "ask", "sz");
snprintf(buffer, 512, "%-5s %-14s | %-14s %-5s\n", "sz", "bid", "ask", "sz");
ss << buffer;
ss << "---------- ---------- ----------\n";
ss << "-------------------- - -------------------- \n";
for (auto x = COCONUT_MAX_DEPTH; x != 0; --x) {
auto a = ask[x-1];
if (!os::is_nan(a.price())) {
snprintf(buffer, 512, "%4s %10s | %10.7f %4d\n", "", "", a.price(), a.size());
snprintf(buffer, 512, "%5s %14s | %14.7f %5d\n", "", "", a.price(), a.size());
ss << buffer;
}
}
ss << "---------- ---------- ----------\n";
ss << "-------------------- - -------------------- \n";
for (uint32_t x = 0; x < COCONUT_MAX_DEPTH; ++x) {
auto b = bid[x];
if (!os::is_nan(b.price())) {
snprintf(buffer, 512, "%4d %10.7f | \n", b.size(), b.price());
snprintf(buffer, 512, "%5d %14.7f | \n", b.size(), b.price());
ss << buffer;
}
}