diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake
index bc458b91fdc7f..548379590a189 100644
--- a/cmake/modules/RootConfiguration.cmake
+++ b/cmake/modules/RootConfiguration.cmake
@@ -415,6 +415,11 @@ if((tbb OR builtin_tbb) AND NOT MSVC)
 else()
   set(hastbb undef)
 endif()
+if(geom)
+  set(hasgeom define)
+else()
+  set(hasgeom undef)
+endif()
 if(root7)
   set(hasroot7 define)
 else()
diff --git a/config/RConfigure.in b/config/RConfigure.in
index 86e038075df55..161279a237eaa 100644
--- a/config/RConfigure.in
+++ b/config/RConfigure.in
@@ -53,6 +53,7 @@
 #@hasroot7@ R__HAS_ROOT7 /**/
 #@use_less_includes@ R__LESS_INCLUDES /**/
 #@hastbb@ R__HAS_TBB /**/
+#@hasgeom@ R__HAS_GEOM /**/
 
 #if defined(R__HAS_VECCORE) && defined(R__HAS_VC)
 #ifndef VECCORE_ENABLE_VC
diff --git a/hist/hist/src/TFormula.cxx b/hist/hist/src/TFormula.cxx
index 972aed876a9e2..ba0e2cc1ee5b1 100644
--- a/hist/hist/src/TFormula.cxx
+++ b/hist/hist/src/TFormula.cxx
@@ -2263,7 +2263,9 @@ void TFormula::ProcessFormula(TString &formula)
          map<TString, Double_t>::iterator constIt = fConsts.find(fun.GetName());
          if (constIt != fConsts.end()) {
             TString pattern = TString::Format("{%s}", fun.GetName());
-            TString value = TString::Format("%lf", (*constIt).second);
+            // #17225: we take into account LC_LOCALE settings for which the decimal separator
+            // is , instead of ., e.g. de_AT.UTF-8
+            TString value = TString::Format("%lf", (*constIt).second).ReplaceAll(",", ".");
             formula.ReplaceAll(pattern, value);
             fun.fFound = true;
             // std::cout << "constant with name " << fun.GetName() << " is found " << std::endl;
diff --git a/hist/hist/test/CMakeLists.txt b/hist/hist/test/CMakeLists.txt
index ef3b7fd0b84bf..04dfa0377abce 100644
--- a/hist/hist/test/CMakeLists.txt
+++ b/hist/hist/test/CMakeLists.txt
@@ -12,9 +12,7 @@ ROOT_ADD_GTEST(testTHn THn.cxx LIBRARIES Hist Matrix MathCore RIO)
 ROOT_ADD_GTEST(testTH1 test_TH1.cxx LIBRARIES Hist)
 ROOT_ADD_GTEST(testTHStack test_THStack.cxx LIBRARIES Hist)
 ROOT_ADD_GTEST(testProject3Dname test_Project3D_name.cxx LIBRARIES Hist)
-if(geom)
-  ROOT_ADD_GTEST(testTFormula test_TFormula.cxx LIBRARIES Hist)
-endif()
+ROOT_ADD_GTEST(testTFormula test_TFormula.cxx LIBRARIES Hist)
 ROOT_ADD_GTEST(testTKDE test_tkde.cxx LIBRARIES Hist)
 ROOT_ADD_GTEST(testTH1FindFirstBinAbove test_TH1_FindFirstBinAbove.cxx LIBRARIES Hist)
 ROOT_ADD_GTEST(test_TEfficiency test_TEfficiency.cxx LIBRARIES Hist)
diff --git a/hist/hist/test/test_TFormula.cxx b/hist/hist/test/test_TFormula.cxx
index ca284cee33c21..834505abf447e 100644
--- a/hist/hist/test/test_TFormula.cxx
+++ b/hist/hist/test/test_TFormula.cxx
@@ -2,8 +2,31 @@
 
 #include "TFormula.h"
 
+#include <locale.h>
+
+#ifdef R__HAS_GEOM
 // Test that autoloading works (ROOT-9840)
 TEST(TFormula, Interp)
 {
-  TFormula f("func", "TGeoBBox::DeclFileLine()");
+   TFormula f("func", "TGeoBBox::DeclFileLine()");
+}
+#endif
+
+class localeRAII {
+   std::string fLocale;
+
+public:
+   localeRAII() : fLocale(setlocale(LC_NUMERIC, nullptr)){};
+   ~localeRAII() { setlocale(LC_NUMERIC, fLocale.c_str()); }
+};
+
+// #17225
+TEST(TFormula, Locale)
+{
+   localeRAII lraii;
+   setlocale(LC_NUMERIC, "de_AT.UTF-8");
+   TFormula f0("f0", "gausn(x)");
+   EXPECT_TRUE(f0.IsValid());
+   TFormula f1("f1", "landau(x)");
+   EXPECT_TRUE(f1.IsValid());
 }