mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-03 05:27:20 -05:00
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:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user