mirror of
https://github.com/Tribufu/TribufuDotNet
synced 2026-08-14 23:21:07 +00:00
Create C# projects
This commit is contained in:
parent
16c9711596
commit
30075eca9a
16 changed files with 254 additions and 2 deletions
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Tribufu.Serialization.Newtonsoft
|
||||
{
|
||||
public class DecimalStringConverter : JsonConverter<decimal>
|
||||
{
|
||||
public override decimal ReadJson(JsonReader reader, Type objectType, decimal existingValue, bool hasExistingValue, JsonSerializer serializer)
|
||||
{
|
||||
return decimal.Parse(reader.ToString());
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, decimal value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteValue(value.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue