From d3b7e3fe0dd8d1846ca884e7a2fc427ca425ab83 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Thu, 18 Nov 2021 18:46:35 +1000 Subject: [PATCH] Use P# format instead of custom --- src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs | 4 +--- src/BizHawk.Client.EmuHawk/config/RewindConfig.cs | 2 +- src/BizHawk.Client.EmuHawk/tools/CDL.cs | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs b/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs index 0d3f377175..ea0a060b31 100644 --- a/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs @@ -317,9 +317,7 @@ namespace BizHawk.Client.EmuHawk public void TbScanlineIntensity_Scroll(object sender, EventArgs e) { _config.TargetScanlineFilterIntensity = tbScanlineIntensity.Value; - int scanlines = _config.TargetScanlineFilterIntensity; - float percentage = (float) scanlines / 256 * 100; - lblScanlines.Text = $"{percentage:F2}%"; + lblScanlines.Text = $"{_config.TargetScanlineFilterIntensity / 256.0:P2}"; } private void TrackBarFrameSizeWindowed_ValueChanged(object sender, EventArgs e) diff --git a/src/BizHawk.Client.EmuHawk/config/RewindConfig.cs b/src/BizHawk.Client.EmuHawk/config/RewindConfig.cs index f4d6fb1196..1b6a75b9d7 100755 --- a/src/BizHawk.Client.EmuHawk/config/RewindConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/RewindConfig.cs @@ -34,7 +34,7 @@ namespace BizHawk.Client.EmuHawk var rewinder = _getRewinder(); if (rewinder?.Active == true) { - FullnessLabel.Text = $"{rewinder.FullnessRatio * 100:0.00}%"; + FullnessLabel.Text = $"{rewinder.FullnessRatio:P2}"; RewindFramesUsedLabel.Text = rewinder.Count.ToString(); _avgStateSize = rewinder.Size * rewinder.FullnessRatio / rewinder.Count; } diff --git a/src/BizHawk.Client.EmuHawk/tools/CDL.cs b/src/BizHawk.Client.EmuHawk/tools/CDL.cs index 96f893ca92..1f334740c5 100644 --- a/src/BizHawk.Client.EmuHawk/tools/CDL.cs +++ b/src/BizHawk.Client.EmuHawk/tools/CDL.cs @@ -172,7 +172,7 @@ namespace BizHawk.Client.EmuHawk var lvi = _listContents[idx++] = new string[13]; lvi[0] = $"{addr:X8}"; lvi[1] = scope; - lvi[2] = $"{total / (float) dataA.Length * 100f:0.00}%"; + lvi[2] = $"{total / (float) dataA.Length:P2}"; if (tsbViewStyle.SelectedIndex == 2) lvi[3] = $"{total / 1024.0f:0.00}"; else @@ -188,7 +188,7 @@ namespace BizHawk.Client.EmuHawk for (int i = 0; i < 8; i++) { if (tsbViewStyle.SelectedIndex == 0) - lvi[5 + i] = $"{totals[i] / (float) dataA.Length * 100f:0.00}%"; + lvi[5 + i] = $"{totals[i] / (float) dataA.Length:P2}"; if (tsbViewStyle.SelectedIndex == 1) lvi[5 + i] = $"{totals[i]}"; if (tsbViewStyle.SelectedIndex == 2)