From d84f576ea7c3da3e4d8cc6479734df5fb667a7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Wed, 22 Feb 2017 21:52:37 +0000 Subject: [PATCH] [GB.SETTINGS] * BUG: Settings: Correctly write small float values. git-svn-id: svn://localhost/gambas/trunk@8103 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.settings/.src/Main.module | 5 ++--- comp/src/gb.settings/.src/Settings.class | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/comp/src/gb.settings/.src/Main.module b/comp/src/gb.settings/.src/Main.module index 051a81e34..f5397a5e5 100644 --- a/comp/src/gb.settings/.src/Main.module +++ b/comp/src/gb.settings/.src/Main.module @@ -10,10 +10,9 @@ Public Sub Main() ' hSettings.Save hSettings = New Settings("~/test.conf") - b = hSettings["Cat1/Values"] - b[1] = True - hSettings["Cat1/Values"] = b + hSettings["Test"] = 0.00000001 hSettings.Save + hSettings.Reload ' Settings.Save hSettings["localhost/Login"] = "" ' hSettings["Charlie/Login"] = "Toto" diff --git a/comp/src/gb.settings/.src/Settings.class b/comp/src/gb.settings/.src/Settings.class index 82de94fb4..3014c91f7 100644 --- a/comp/src/gb.settings/.src/Settings.class +++ b/comp/src/gb.settings/.src/Settings.class @@ -536,7 +536,7 @@ Static Private Sub WriteValue(vVal As Variant) Case gb.Float sStr = CStr(vVal) - If InStr(sStr, ".") = 0 Then sStr &= ".0" + If InStr(sStr, ".") = 0 And If InStr(sStr, "E", 1, gb.IgnoreCase) = 0 Then sStr &= ".0" $sStr &= sStr Case gb.Date