22using System . Collections . Generic ;
33using System . ComponentModel ;
44using System . Diagnostics ;
5+ using System . Globalization ;
56using System . IO ;
67using System . Linq ;
78using System . Text ;
@@ -248,7 +249,7 @@ static int Main(string[] args)
248249 var branchPercent = summary . CalculateBranchCoverage ( _module . Value ) . Percent ;
249250 var methodPercent = summary . CalculateMethodCoverage ( _module . Value ) . Percent ;
250251
251- coverageTable . AddRow ( Path . GetFileNameWithoutExtension ( _module . Key ) , $ "{ linePercent } %", $ "{ branchPercent } %", $ "{ methodPercent } %") ;
252+ coverageTable . AddRow ( Path . GetFileNameWithoutExtension ( _module . Key ) , $ "{ InvariantFormat ( linePercent ) } %", $ "{ InvariantFormat ( branchPercent ) } %", $ "{ InvariantFormat ( methodPercent ) } %") ;
252253 }
253254
254255 logger . LogInformation ( coverageTable . ToStringAlternative ( ) ) ;
@@ -257,8 +258,8 @@ static int Main(string[] args)
257258 coverageTable . Rows . Clear ( ) ;
258259
259260 coverageTable . AddColumn ( new [ ] { "" , "Line" , "Branch" , "Method" } ) ;
260- coverageTable . AddRow ( "Total" , $ "{ totalLinePercent } %", $ "{ totalBranchPercent } %", $ "{ totalMethodPercent } %") ;
261- coverageTable . AddRow ( "Average" , $ "{ averageLinePercent } %", $ "{ averageBranchPercent } %", $ "{ averageMethodPercent } %") ;
261+ coverageTable . AddRow ( "Total" , $ "{ InvariantFormat ( totalLinePercent ) } %", $ "{ InvariantFormat ( totalBranchPercent ) } %", $ "{ InvariantFormat ( totalMethodPercent ) } %") ;
262+ coverageTable . AddRow ( "Average" , $ "{ InvariantFormat ( averageLinePercent ) } %", $ "{ InvariantFormat ( averageBranchPercent ) } %", $ "{ InvariantFormat ( averageMethodPercent ) } %") ;
262263
263264 logger . LogInformation ( coverageTable . ToStringAlternative ( ) ) ;
264265 if ( process . ExitCode > 0 )
@@ -314,5 +315,7 @@ static int Main(string[] args)
314315 }
315316
316317 static string GetAssemblyVersion ( ) => typeof ( Program ) . Assembly . GetName ( ) . Version . ToString ( ) ;
318+
319+ static string InvariantFormat ( double value ) => value . ToString ( CultureInfo . InvariantCulture ) ;
317320 }
318321}
0 commit comments