Repository: microsoft/terminal (language: cpp)

Issue:
Odd behavior when using fractional font size in SUI
### Windows Terminal version

main c51bb3a7a

### Windows build number

10.0.19044.0

### Other Software

_No response_

### Steps to reproduce

build terminal with `Add support for fractional font size` commit included

### Expected Behavior

consistent fractional part

### Actual Behavior

when using any other fractional beside `.5` the font size is being expanded to 10 decimal places, overlapping the controls:

![fractional_font_size](https://user-images.githubusercontent.com/3933920/190837778-62e17911-ecda-42be-b05d-bbac1ac1e7e7.PNG)

when incrementing/decrementing with the up/down arrows only the integer part is being changed, i.e. `13.5 , 14.5, 15.5`


Discussion / hints:

Fix patch:
diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.cpp b/src/cascadia/TerminalSettingsEditor/Appearances.cpp
index e9760b88606..49d3082350e 100644
--- a/src/cascadia/TerminalSettingsEditor/Appearances.cpp
+++ b/src/cascadia/TerminalSettingsEditor/Appearances.cpp
@@ -91,6 +91,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
     {
         InitializeComponent();
 
+        {
+            using namespace winrt::Windows::Globalization::NumberFormatting;
+            // > .NET rounds to 12 significant digits when displaying doubles, so we will [...]
+            // ...obviously not do that, because this is an UI element for humans. This prevents
+            // issues when displaying 32-bit floats, because WinUI is unaware about their existence.
+            SignificantDigitsNumberRounder rounder;
+            rounder.SignificantDigits(6);
+            // BODGY: Depends on WinUI internals.
+            _fontSizeBox().NumberFormatter().as<DecimalFormatter>().NumberRounder(rounder);
+        }
+
         INITIALIZE_BINDABLE_ENUM_SETTING(CursorShape, CursorStyle, winrt::Microsoft::Terminal::Core::CursorStyle, L"Profile_CursorShape", L"Content");
         INITIALIZE_BINDABLE_ENUM_SETTING(AdjustIndistinguishableColors, AdjustIndistinguishableColors, winrt::Microsoft::Terminal::Core::AdjustTextMode, L"Profile_AdjustIndistinguishableColors", L"Content");
         INITIALIZE_BINDABLE_ENUM_SETTING_REVERSE_ORDER(BackgroundImageStretchMode, BackgroundImageStretchMode, winrt::Windows::UI::Xaml::Media::Stretch, L"Profile_BackgroundImageStretchMode", L"Content");
diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.xaml b/src/cascadia/TerminalSettingsEditor/Appearances.xaml
index 2b00dbe545c..2e348581216 100644
--- a/src/cascadia/TerminalSettingsEditor/Appearances.xaml
+++ b/src/cascadia/TerminalSettingsEditor/Appearances.xaml
@@ -93,7 +93,8 @@
                                     HasSettingValue="{x:Bind Appearance.HasFontSize, Mode=OneWay}"
                                     SettingOverrideSource="{x:Bind Appearance.FontSizeOverrideSource, Mode=OneWay}"
                                     Visibility="{x:Bind Appearance.IsDefault, Mode=OneWay}">
-                <muxc:NumberBox x:Uid="Profile_FontSizeBox"
+                <muxc:NumberBox x:Name="_fontSizeBox"
+                                x:Uid="Profile_FontSizeBox"
                                 AcceptsExpression="False"
                                 LargeChange="10"
                                 Maximum="128"
diff --git a/src/cascadia/TerminalSettingsEditor/pch.h b/src/cascadia/TerminalSettingsEditor/pch.h
index 55bc7318e38..f677edda3e0 100644
--- a/src/cascadia/TerminalSettingsEditor/pch.h
+++ b/src/cascadia/TerminalSettingsEditor/pch.h
@@ -24,6 +24,7 @@
 #include <winrt/Windows.Foundation.h>
 #include <winrt/Windows.Foundation.Collections.h>
 #include <winrt/Windows.Globalization.h>
+#include <winrt/Windows.Globalization.NumberFormatting.h>
 #include <winrt/Windows.System.h>
 #include <winrt/Windows.UI.h>
 #include <winrt/Windows.UI.Core.h>


Test patch: