C#C
C#15mo ago
novaleaf

how to avoid "-0" when converting float to string?

when I convert floats to string like in this example, often I get "-0" as a value. Does anyone know a simple way to convert these to positive zero?
    public static string _Serialize(this Vector3 value)
    {
        return $"{value.X}, {value.Y}, {value.Z}";
    }


this is for serialization purposes, so I'd like to avoid some heavy checks just to avoid -0
Was this page helpful?