]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Use a fixed amount of decimal points in gas analyzer window (#40081)
authoropl- <opl-@users.noreply.github.com>
Wed, 3 Sep 2025 20:49:50 +0000 (22:49 +0200)
committerGitHub <noreply@github.com>
Wed, 3 Sep 2025 20:49:50 +0000 (22:49 +0200)
This prevents the volume and temperature labels from changing width when the value lands on integer values, making the text easier to read.

Co-authored-by: opl <4833621+opl@users.noreply.github.com>
Content.Client/Atmos/UI/GasAnalyzerWindow.xaml.cs

index e280523e43e63a5b6235629c678a71f51eac6482..63b4e6b0c6f5cc218d0c8d156ab90b1619706700 100644 (file)
@@ -208,7 +208,7 @@ namespace Content.Client.Atmos.UI
             });
             presBox.AddChild(new Label
             {
-                Text = Loc.GetString("gas-analyzer-window-pressure-val-text", ("pressure", $"{gasMix.Pressure:0.##}")),
+                Text = Loc.GetString("gas-analyzer-window-pressure-val-text", ("pressure", $"{gasMix.Pressure:0.00}")),
                 Align = Label.AlignMode.Right,
                 HorizontalExpand = true
             });
@@ -232,8 +232,8 @@ namespace Content.Client.Atmos.UI
                 tempBox.AddChild(new Label
                 {
                     Text = Loc.GetString("gas-analyzer-window-temperature-val-text",
-                        ("tempK", $"{gasMix.Temperature:0.#}"),
-                        ("tempC", $"{TemperatureHelpers.KelvinToCelsius(gasMix.Temperature):0.#}")),
+                        ("tempK", $"{gasMix.Temperature:0.0}"),
+                        ("tempC", $"{TemperatureHelpers.KelvinToCelsius(gasMix.Temperature):0.0}")),
                     Align = Label.AlignMode.Right,
                     HorizontalExpand = true
                 });