2
2
using System . Collections . Generic ;
3
3
using System . ComponentModel ;
4
4
using System . Diagnostics ;
5
+ using System . Globalization ;
5
6
using System . IO ;
6
7
using System . Linq ;
7
8
using System . Text ;
@@ -248,7 +249,7 @@ static int Main(string[] args)
248
249
var branchPercent = summary . CalculateBranchCoverage ( _module . Value ) . Percent ;
249
250
var methodPercent = summary . CalculateMethodCoverage ( _module . Value ) . Percent ;
250
251
251
- coverageTable . AddRow ( Path . GetFileNameWithoutExtension ( _module . Key ) , $ "{ linePercent } %", $ "{ branchPercent } %", $ "{ methodPercent } %") ;
252
+ coverageTable . AddRow ( Path . GetFileNameWithoutExtension ( _module . Key ) , $ "{ InvariantFormat ( linePercent ) } %", $ "{ InvariantFormat ( branchPercent ) } %", $ "{ InvariantFormat ( methodPercent ) } %") ;
252
253
}
253
254
254
255
logger . LogInformation ( coverageTable . ToStringAlternative ( ) ) ;
@@ -257,8 +258,8 @@ static int Main(string[] args)
257
258
coverageTable . Rows . Clear ( ) ;
258
259
259
260
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 ) } %") ;
262
263
263
264
logger . LogInformation ( coverageTable . ToStringAlternative ( ) ) ;
264
265
if ( process . ExitCode > 0 )
@@ -314,5 +315,7 @@ static int Main(string[] args)
314
315
}
315
316
316
317
static string GetAssemblyVersion ( ) => typeof ( Program ) . Assembly . GetName ( ) . Version . ToString ( ) ;
318
+
319
+ static string InvariantFormat ( double value ) => value . ToString ( CultureInfo . InvariantCulture ) ;
317
320
}
318
321
}
0 commit comments