diff --git a/src/OpenFOAM/db/dictionary/functionEntries/ifEntry/ifEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/ifEntry/ifEntry.C
index 18a18b2f32f14c41a455ed47a55247a6ccbec1d7..a07577994850f02b7e091a8a59119f9c6ebaf7e9 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/ifEntry/ifEntry.C
+++ b/src/OpenFOAM/db/dictionary/functionEntries/ifEntry/ifEntry.C
@@ -6,6 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2018 OpenFOAM Foundation
+    Copyright (C) 2019 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -51,6 +52,24 @@ namespace functionEntries
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
+bool Foam::functionEntries::ifEntry::isTrue(ITstream& its)
+{
+    Switch logic;
+
+    if (its.size() && its.first().isScalar())
+    {
+        // Use default rounding tolerance
+        logic = Switch(its.first().scalarToken());
+    }
+    else
+    {
+        its >> logic;
+    }
+
+    return logic;
+}
+
+
 bool Foam::functionEntries::ifEntry::execute
 (
     DynamicList<filePos>& stack,
@@ -68,13 +87,14 @@ bool Foam::functionEntries::ifEntry::execute
     line += ';';
     IStringStream lineStream(line);
     const primitiveEntry e("ifEntry", parentDict, lineStream);
-    const Switch doIf(e.stream());
 
-    // Info<< "Using #" << typeName << " " << doIf
+    const bool doIf = ifEntry::isTrue(e.stream());
+
+    // Info<< "Using #" << typeName << " " << Switch::name(doIf)
     //     << " at line " << stack.last().second()
     //     << " in file " <<  stack.last().first() << endl;
 
-    bool ok = ifeqEntry::execute(doIf, stack, parentDict, is);
+    const bool ok = ifeqEntry::execute(doIf, stack, parentDict, is);
 
     if (stack.size() != nNested)
     {
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/ifEntry/ifEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/ifEntry/ifEntry.H
index 769d63e580a889f93e8ba4768a301fa5b851e558..364247dad9bb5d8814ff21c0e5aa035d3205f0ab 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/ifEntry/ifEntry.H
+++ b/src/OpenFOAM/db/dictionary/functionEntries/ifEntry/ifEntry.H
@@ -43,7 +43,7 @@ Description
     Note:
     - only supports single line, '\' is not supported
     - condition should be readable as a \c Switch
-      (supports 0,1, true, false, etc.)
+      (0,1, true, false, etc.) or a scalar (0.0, ...)
 
 See also
     Foam::functionEntries::ifeqEntry
@@ -78,6 +78,9 @@ class ifEntry
 
     // Private Member Functions
 
+        //- Test first token (label, scalar, word) for true/false
+        static bool isTrue(ITstream& is);
+
         //- Execute the functionEntry in a sub-dict context
         static bool execute
         (
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/ifeqEntry/ifeqEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/ifeqEntry/ifeqEntry.C
index 154b1a543bb2f65336c7848f9be2039a42f4d7d8..a4dd8edfab3b55b125bd0a2bf7600c6d8bab88fa 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/ifeqEntry/ifeqEntry.C
+++ b/src/OpenFOAM/db/dictionary/functionEntries/ifeqEntry/ifeqEntry.C
@@ -27,9 +27,8 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "ifeqEntry.H"
-#include "stringOps.H"
 #include "ifEntry.H"
-#include "Switch.H"
+#include "stringOps.H"
 #include "addToMemberFunctionSelectionTable.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@@ -367,9 +366,8 @@ bool Foam::functionEntries::ifeqEntry::execute
                 line += ';';
                 IStringStream lineStream(line);
                 const primitiveEntry e("ifEntry", parentDict, lineStream);
-                const Switch doIf(e.stream());
 
-                if (doIf)
+                if (ifEntry::isTrue(e.stream()))
                 {
                     // Info<< "Using #elif " << doIf << " at line " << lineNo
                     //     << " in file " << is.name() << endl;
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/ifeqEntry/ifeqEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/ifeqEntry/ifeqEntry.H
index 60b23f66bf08e3ebc665040a8b19c98d28df8378..a04b91fc8179ebbbc0124c466e9be1a60b45742b 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/ifeqEntry/ifeqEntry.H
+++ b/src/OpenFOAM/db/dictionary/functionEntries/ifeqEntry/ifeqEntry.H
@@ -139,7 +139,7 @@ protected:
         );
 
         //- Main driver: depending on 'equal' starts evaluating or
-        //  skips forward to #else
+        //- skips forward to #else
         static bool execute
         (
             const bool equal,
@@ -149,7 +149,7 @@ protected:
         );
 
         //- Main driver: depending on 'equal' starts evaluating or
-        //  skips forward to #else
+        //- skips forward to #else
         static bool execute
         (
             DynamicList<filePos>& stack,
diff --git a/tutorials/IO/dictionary/good-if.dict b/tutorials/IO/dictionary/good-if.dict
index 833cd203602faefb16ca43b8de4e66eba562af44..0b7068a9c1d1f242305da4d0e1398bcdc356a80c 100644
--- a/tutorials/IO/dictionary/good-if.dict
+++ b/tutorials/IO/dictionary/good-if.dict
@@ -1,16 +1,16 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  v1906                                 |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|  \\    /   O peration     | Version:  v1912                                 |
+|   \\  /    A nd           | Website:  www.openfoam.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
 {
-    version         2;
-    format          ascii;
-    class           dictionary;
-    object          dictionary;
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    object      dictionary;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -26,3 +26,5 @@ FoamFile
 #else
     version "other";
 #endif
+
+// ************************************************************************* //
diff --git a/tutorials/IO/dictionary/good-if2.dict b/tutorials/IO/dictionary/good-if2.dict
new file mode 100644
index 0000000000000000000000000000000000000000..7b51cf6f32db5763e1a2b9c955b99610feb61f31
--- /dev/null
+++ b/tutorials/IO/dictionary/good-if2.dict
@@ -0,0 +1,32 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  v1912                                 |
+|   \\  /    A nd           | Website:  www.openfoam.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    object      dictionary;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+// Do comparison
+
+#if #eval "${FOAM_API:-0}"
+    foamApi nonZero;
+#else
+    foamApi zeroValue;
+#endif
+
+#if #eval "${XX_XXX_FOAM_API:-1000}"
+    other "some entry";
+#else
+    other "unexpected";
+#endif
+
+
+// ************************************************************************* //