20 lines
606 B
C#
20 lines
606 B
C#
using System.Globalization;
|
|
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace HM5.Server.Json
|
|
{
|
|
public class FloatToStringConverter : JsonConverter<float>
|
|
{
|
|
public override float Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override void Write(Utf8JsonWriter writer, float value, JsonSerializerOptions options)
|
|
{
|
|
writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture));
|
|
}
|
|
}
|
|
}
|