diff --git a/.gitignore b/.gitignore index 4093dd21..0be7c159 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ obj/ BenchmarkDotNet.Artifacts/ *.swp Parquet.sln.DotSettings.user +.DS_Store diff --git a/src/Parquet/Extensions/StringBuilderExtensions.cs b/src/Parquet/Extensions/StringBuilderExtensions.cs index 6f659d8b..acd83302 100644 --- a/src/Parquet/Extensions/StringBuilderExtensions.cs +++ b/src/Parquet/Extensions/StringBuilderExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Globalization; using System.Text; using Parquet.Rows; using Parquet.Schema; @@ -120,6 +121,15 @@ private static void EncodeJson(StringBuilder sb, StringFormat sf, object? value) sb.Append(quote); sb.Append(Convert.ToBase64String((byte[])value)); sb.Append(quote); + } + else if(t == typeof(decimal)) { + sb.Append(((decimal)value).ToString(CultureInfo.InvariantCulture)); + } + else if(t == typeof(float)) { + sb.Append(((float)value).ToString(CultureInfo.InvariantCulture)); + } + else if(t == typeof(double)) { + sb.Append(((double)value).ToString(CultureInfo.InvariantCulture)); } else { sb.Append(value.ToString());