From 7803447f6a5e60c0d73efb7a2aeaa2ef5411e0db Mon Sep 17 00:00:00 2001 From: Mythos Date: Tue, 29 Oct 2024 12:42:41 +0100 Subject: [PATCH] bugfix large numbers --- Gps.cs | 2 +- MainWindow.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gps.cs b/Gps.cs index 9929a39..fe0fdcf 100644 --- a/Gps.cs +++ b/Gps.cs @@ -78,7 +78,7 @@ public static string GetGpsString(string name, string x, string y, string z, str public static string GetGpsString(string name, float x, float y, float z, string color) { - return GetGpsString(name, x.ToString(NumberFormat), y.ToString(NumberFormat), z.ToString(NumberFormat), color); + return GetGpsString(name, x.ToString("0.##", NumberFormat), y.ToString("0.##", NumberFormat), z.ToString("0.##", NumberFormat), color); } public static string GetGpsString(string name, Vector3 v, string color) diff --git a/MainWindow.cs b/MainWindow.cs index 0c98f03..cad31cc 100644 --- a/MainWindow.cs +++ b/MainWindow.cs @@ -89,9 +89,9 @@ private void Gps_Changed(object sender, Gps gps) SetTextBox(sender, tbGPS, gps.ToString()); SetTextBox(sender, tbName, gps.Name); - SetTextBox(sender, tbX, gps.X.ToString(Gps.NumberFormat)); - SetTextBox(sender, tbY, gps.Y.ToString(Gps.NumberFormat)); - SetTextBox(sender, tbZ, gps.Z.ToString(Gps.NumberFormat)); + SetTextBox(sender, tbX, gps.X.ToString("0.##", Gps.NumberFormat)); + SetTextBox(sender, tbY, gps.Y.ToString("0.##", Gps.NumberFormat)); + SetTextBox(sender, tbZ, gps.Z.ToString("0.##", Gps.NumberFormat)); SetTextBox(sender, tbColor, gps.Color); try {