From e9b3f1154d422e2239be1faa3a719cf8f8849f2a Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Fri, 10 Jul 2015 22:46:48 +0200 Subject: [PATCH] IniFile: Use a formatting for floats that makes them survive round-trips to a decimal string and back in all cases. See https://randomascii.wordpress.com/2012/03/08/float-precisionfrom-zero-to-100-digits-2/ --- Source/Core/Common/IniFile.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/IniFile.h b/Source/Core/Common/IniFile.h index fc39e783cc..0ccb25a1a5 100644 --- a/Source/Core/Common/IniFile.h +++ b/Source/Core/Common/IniFile.h @@ -47,12 +47,12 @@ public: void Set(const std::string& key, float newValue) { - Set(key, StringFromFormat("%f", newValue)); + Set(key, StringFromFormat("%#.9g", newValue)); } void Set(const std::string& key, double newValue) { - Set(key, StringFromFormat("%f", newValue)); + Set(key, StringFromFormat("%#.17g", newValue)); } void Set(const std::string& key, int newValue)