зеркало из https://github.com/stride3d/SharpYaml.git
Modified a unit test to fail due to issue #10 (serializing decimal types)
Fixed issue #10 which prevented the serialization of C# decimal types Martin Evans <martindevans@gmail.com>
This commit is contained in:
Родитель
e3d65d7b07
Коммит
48566a08c2
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче