From ab071d9accd8d2ada9ad0eb239c92b5eec401bd1 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Wed, 17 May 2017 12:00:41 +0200 Subject: [PATCH] Use fixed formatting for percentages in heaptrack_print Otherwise we could end up printing 100% as "1.00E2%". Now, we will print it as "100.00%". --- src/analyze/print/heaptrack_print.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/analyze/print/heaptrack_print.cpp b/src/analyze/print/heaptrack_print.cpp index 6881e80..a67e371 100644 --- a/src/analyze/print/heaptrack_print.cpp +++ b/src/analyze/print/heaptrack_print.cpp @@ -720,12 +720,12 @@ int main(int argc, char** argv) data.printAllocations(&AllocationData::temporary, [](const AllocationData& data) { cout << data.temporary << " temporary allocations of " << data.allocations - << " allocations in total (" << setprecision(2) + << " allocations in total (" << fixed << setprecision(2) << (float(data.temporary) * 100.f / data.allocations) << "%) from\n"; }, [](const AllocationData& data) { cout << data.temporary << " temporary allocations of " << data.allocations - << " allocations in total (" << setprecision(2) + << " allocations in total (" << fixed << setprecision(2) << (float(data.temporary) * 100.f / data.allocations) << "%) from:\n"; }); cout << endl; -- 2.7.4