[llvm-cov] Fix incorrect usage of .precision specifier in format() call.

Summary: Existing version doesn't work on Windows as it always prints 0.00.

Reviewers: Dor1s

Reviewed By: Dor1s

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D42767

llvm-svn: 323923
This commit is contained in:
Max Moroz 2018-01-31 22:13:07 +00:00
parent 43e94b15ea
commit 74295975f4

View File

@ -343,7 +343,7 @@ void CoveragePrinterHTML::emitFileSummary(raw_ostream &OS, StringRef SF,
{
raw_string_ostream RSO{S};
if (Total)
RSO << format("%6.2f", 7, Pctg) << "% ";
RSO << format("%*.2f", 7, Pctg) << "% ";
else
RSO << "- ";
RSO << '(' << Hit << '/' << Total << ')';