From 613eeec75096473728a74c17a7d64b4facb1d9eb Mon Sep 17 00:00:00 2001 From: andyvorld Date: Fri, 3 Jul 2020 01:41:50 +1000 Subject: [PATCH] Made double.parse culture invariant --- LGSTrayBattery/PowerModel.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LGSTrayBattery/PowerModel.cs b/LGSTrayBattery/PowerModel.cs index 8bc70c5..77dc70e 100644 --- a/LGSTrayBattery/PowerModel.cs +++ b/LGSTrayBattery/PowerModel.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Globalization; using System.IO; using System.Linq; using System.Text; @@ -44,7 +45,10 @@ public PowerModel(UInt16 WPID) var temp = dischargeCurveNode.Value.Trim('\n', ' ').Split(new char[] { '\n', }, StringSplitOptions.RemoveEmptyEntries); - _dischargeCurve = temp.ToList().ConvertAll(x => Array.ConvertAll(x.Split(','), Double.Parse)); + _dischargeCurve = Array.ConvertAll(temp, + x => Array.ConvertAll(x.Split(','), + new Converter(y => + Double.Parse(y, NumberStyles.Any, CultureInfo.InvariantCulture)))).ToList(); if (_dischargeCurve[0][LUTCol.Volt] > _dischargeCurve[1][LUTCol.Volt]) {