Skip to content

Commit 54339d0

Browse files
committed
use CultureInfo for parsing estimates
In cultures with ',' as the decimal seperator, Decimal.Parse parses "0.68" as 68 instead of 0.68 if you do it without specifying the culture, which made ratioavg take some really silly values
1 parent 8016227 commit 54339d0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

WindowsApp1/WikiHandler.vb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Imports System.IO
2+
Imports System.Globalization
23
Imports System.Net
34
Imports System.Text
45
Imports System.Text.RegularExpressions
@@ -79,7 +80,8 @@ Public Class WikiHandler
7980
WikiPopup.GamesTable.Controls.Clear()
8081
WikiPopup.GamesTable.RowCount = 0
8182

82-
83+
Dim provider As CultureInfo
84+
provider = New CultureInfo("en-US")
8385

8486
Dim GName As New Label
8587
GName.Text = "Game"
@@ -120,7 +122,7 @@ Public Class WikiHandler
120122

121123
FillTable(n)
122124

123-
ratioavg += Decimal.Parse(InputFromGitHub(n).Split("|")(6))
125+
ratioavg += Decimal.Parse(InputFromGitHub(n).Split("|")(6), provider)
124126
If InputFromGitHub(n).Split("|")(7).Contains("*") Then
125127
Compact.sb_lblGameIssues.Visible = True
126128
Compact.sb_lblGameIssues.Text = "! Game has issues"

0 commit comments

Comments
 (0)