From 9e9bee8f0994174454cf74d32000302fa01ad260 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 10 Dec 2024 09:42:31 +0100 Subject: [PATCH] Increase precision to 2 digits (2.3% => 2.34%) 2 numbers makes a difference for large code base (Usefull in Gitlab where you can check coverage before validating a Merge Request) --- .../Reporting/Builders/TextSummaryReportBuilder.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ReportGenerator.Core/Reporting/Builders/TextSummaryReportBuilder.cs b/src/ReportGenerator.Core/Reporting/Builders/TextSummaryReportBuilder.cs index b715eed4..b45ec9cc 100644 --- a/src/ReportGenerator.Core/Reporting/Builders/TextSummaryReportBuilder.cs +++ b/src/ReportGenerator.Core/Reporting/Builders/TextSummaryReportBuilder.cs @@ -106,7 +106,7 @@ public void CreateSummaryReport(SummaryResult summaryResult) reportTextWriter.WriteLine(" {0} {1}", ReportResources.Assemblies2, assembliesWithClasses.Count().ToString(CultureInfo.InvariantCulture)); reportTextWriter.WriteLine(" {0} {1}", ReportResources.Classes, assembliesWithClasses.SelectMany(a => a.Classes).Count().ToString(CultureInfo.InvariantCulture)); reportTextWriter.WriteLine(" {0} {1}", ReportResources.Files2, assembliesWithClasses.SelectMany(a => a.Classes).SelectMany(a => a.Files).Distinct().Count().ToString(CultureInfo.InvariantCulture)); - reportTextWriter.WriteLine(" {0} {1}", ReportResources.Coverage2, summaryResult.CoverageQuota.HasValue ? summaryResult.CoverageQuota.Value.ToString("f1", CultureInfo.InvariantCulture) + "%" : string.Empty); + reportTextWriter.WriteLine(" {0} {1}", ReportResources.Coverage2, summaryResult.CoverageQuota.HasValue ? summaryResult.CoverageQuota.Value.ToString("f2", CultureInfo.InvariantCulture) + "%" : string.Empty); reportTextWriter.WriteLine(" {0} {1}", ReportResources.CoveredLines, summaryResult.CoveredLines.ToString(CultureInfo.InvariantCulture)); reportTextWriter.WriteLine(" {0} {1}", ReportResources.UncoveredLines, (summaryResult.CoverableLines - summaryResult.CoveredLines).ToString(CultureInfo.InvariantCulture)); reportTextWriter.WriteLine(" {0} {1}", ReportResources.CoverableLines, summaryResult.CoverableLines.ToString(CultureInfo.InvariantCulture)); @@ -146,7 +146,7 @@ public void CreateSummaryReport(SummaryResult summaryResult) foreach (var assembly in assembliesWithClasses) { - string assemblyQuota = assembly.CoverageQuota.HasValue ? assembly.CoverageQuota.Value.ToString("f1", CultureInfo.InvariantCulture) + "%" : string.Empty; + string assemblyQuota = assembly.CoverageQuota.HasValue ? assembly.CoverageQuota.Value.ToString("f2", CultureInfo.InvariantCulture) + "%" : string.Empty; reportTextWriter.WriteLine(); reportTextWriter.WriteLine( "{0}{1} {2}", @@ -156,7 +156,7 @@ public void CreateSummaryReport(SummaryResult summaryResult) foreach (var @class in assembly.Classes) { - string classQuota = @class.CoverageQuota.HasValue ? @class.CoverageQuota.Value.ToString("f1", CultureInfo.InvariantCulture) + "%" : string.Empty; + string classQuota = @class.CoverageQuota.HasValue ? @class.CoverageQuota.Value.ToString("f2", CultureInfo.InvariantCulture) + "%" : string.Empty; reportTextWriter.WriteLine( " {0}{1} {2}", @class.DisplayName,