diff --git a/SharpYaml.Tests/Serialization/SerializationTests2.cs b/SharpYaml.Tests/Serialization/SerializationTests2.cs index f74a209..0840905 100644 --- a/SharpYaml.Tests/Serialization/SerializationTests2.cs +++ b/SharpYaml.Tests/Serialization/SerializationTests2.cs @@ -203,7 +203,9 @@ Value: World! public ulong UInt64 { get; set; } - public float Float { get; set; } + public decimal Decimal { get; set; } + + public float Float { get; set; } public double Double { get; set; } @@ -235,6 +237,7 @@ ArrayContent: [1, 2] Bool: true BoolFalse: false Byte: 2 +Decimal: 4623451.0232342352463856744563 Double: 6.6 Enum: B EnumWithFlags: A, B diff --git a/SharpYaml/Serialization/Serializers/PrimitiveSerializer.cs b/SharpYaml/Serialization/Serializers/PrimitiveSerializer.cs index 75a9c6f..641793e 100644 --- a/SharpYaml/Serialization/Serializers/PrimitiveSerializer.cs +++ b/SharpYaml/Serialization/Serializers/PrimitiveSerializer.cs @@ -235,7 +235,7 @@ namespace SharpYaml.Serialization.Serializers text = AppendDecimalPoint(((double)value).ToString("R", CultureInfo.InvariantCulture)); break; case TypeCode.Decimal: - text = AppendDecimalPoint(((decimal)value).ToString("R", CultureInfo.InvariantCulture)); + text = AppendDecimalPoint(((decimal)value).ToString(CultureInfo.InvariantCulture)); break; case TypeCode.DateTime: text = ((DateTime) value).ToString("o", CultureInfo.InvariantCulture);