Skip to content

Commit 3c4a477

Browse files
committed
Merge branch 'release/2.7.1'
2 parents 857abf8 + 256c636 commit 3c4a477

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/Domain/Dimensions/Dimension.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// limitations under the License.
1515

1616
using System.ComponentModel;
17+
using System.Globalization;
1718
using System.Reflection;
1819
using System.Runtime.CompilerServices;
1920
using System.Text.RegularExpressions;
@@ -88,7 +89,7 @@ public static Dimension Parse(string dimension)
8889
if (!match.Success)
8990
throw new ArgumentException("Invalid dimension format. Expected formats: '200px', '11in', or default to inches.", nameof(dimension));
9091

91-
double value = double.Parse(match.Groups[1].Value);
92+
double value = double.Parse(match.Groups[1].Value, CultureInfo.InvariantCulture);
9293
string? unitStr = match.Groups[3].Success ? match.Groups[3].Value.ToLower() : null;
9394

9495
// Default to Inches if no unit is provided
@@ -149,7 +150,7 @@ public override string ToString()
149150
// if it's inches, don't supply anything.
150151
var unitType = UnitType == DimensionUnitType.Inches ? "" : UnitType.GetDescription();
151152

152-
return $"{Value}{unitType}";
153+
return $"{Value.ToString("G", CultureInfo.InvariantCulture)}{unitType}";
153154
}
154155

155156
public override bool Equals(object? obj)

0 commit comments

Comments
 (0)