X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..d49162286e811faacd7d7f3277da61efdfb635db:/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp

diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp b/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp
index 352dab00..7d63b574 100644
--- a/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp
+++ b/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp
@@ -29,11 +29,12 @@
 #include <string>
 #include <vector>
 #include <sstream>
+#include <cmath>
 
 #include <libpq-fe.h>
 
 #include "postgresql_store.h"
-#include "stg_locker.h"
+#include "stg/locker.h"
 
 //-----------------------------------------------------------------------------
 int POSTGRESQL_STORE::GetTariffsList(vector<string> * tariffsList) const
@@ -543,8 +544,8 @@ for (int i = 0; i < std::min(tuples, DIR_NUM); ++i)
     tuple >> td->dirPrice[dir].hNight;
     tuple >> td->dirPrice[dir].mNight;
 
-    if (td->dirPrice[dir].priceDayA == td->dirPrice[dir].priceNightA &&
-        td->dirPrice[dir].priceDayB == td->dirPrice[dir].priceNightB)
+    if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) > 1.0e-3 &&
+        std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) > 1.0e-3)
         {
         td->dirPrice[dir].singlePrice = true;
         }