From 78eaa518ef37b501e7409467ea3efaa42ebe7ac3 Mon Sep 17 00:00:00 2001 From: KiwifruitDev Date: Sat, 7 Oct 2023 13:15:11 -0700 Subject: [PATCH] DynValue ToString uses InvariantCulture Performing this change allows decimal values to concatenate through strings correctly. --- src/MoonSharp.Interpreter/DataTypes/DynValue.cs | 2 +- .../MoonSharp.Interpreter.netcore/src/DataTypes/DynValue.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MoonSharp.Interpreter/DataTypes/DynValue.cs b/src/MoonSharp.Interpreter/DataTypes/DynValue.cs index 9df80fe0..ac1540be 100644 --- a/src/MoonSharp.Interpreter/DataTypes/DynValue.cs +++ b/src/MoonSharp.Interpreter/DataTypes/DynValue.cs @@ -687,7 +687,7 @@ public string CastToString() DynValue rv = ToScalar(); if (rv.Type == DataType.Number) { - return rv.Number.ToString(); + return rv.Number.ToString(CultureInfo.InvariantCulture); } else if (rv.Type == DataType.String) { diff --git a/src/MoonSharp.Interpreter/_Projects/MoonSharp.Interpreter.netcore/src/DataTypes/DynValue.cs b/src/MoonSharp.Interpreter/_Projects/MoonSharp.Interpreter.netcore/src/DataTypes/DynValue.cs index c3f631a4..8f9bd579 100644 --- a/src/MoonSharp.Interpreter/_Projects/MoonSharp.Interpreter.netcore/src/DataTypes/DynValue.cs +++ b/src/MoonSharp.Interpreter/_Projects/MoonSharp.Interpreter.netcore/src/DataTypes/DynValue.cs @@ -687,7 +687,7 @@ public string CastToString() DynValue rv = ToScalar(); if (rv.Type == DataType.Number) { - return rv.Number.ToString(); + return rv.Number.ToString(CultureInfo.InvariantCulture); } else if (rv.Type == DataType.String) {