Improve display precision of size floats

Use the Round-trip format when converting to string.
https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#RFormatString

The default behavior in net4.~ ToString doesn't use "R", hence me assuming F6 would be sufficient, but it does not display as a round-trip value.

netcore3+ changed the default behavior and aligned it with standards ~ https://devblogs.microsoft.com/dotnet/floating-point-parsing-and-formatting-improvements-in-net-core-3-0/

now, both net461 and net6 builds display the same values. Doesn't resolve the mono issue where legality check flags calc != stored.
This commit is contained in:
Kurt
2022-10-16 18:36:33 -07:00
parent ba53f4a7bc
commit d012134d23

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Globalization;
using System.Windows.Forms;
using PKHeX.Core;
@@ -48,7 +48,7 @@ private void ResetCalculatedStats()
pk?.ResetCP();
}
private static string GetString(float value) => value.ToString("F6", CultureInfo.InvariantCulture);
private static string GetString(float value) => value.ToString("R", CultureInfo.InvariantCulture);
private void LoadStoredValues()
{