]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp
+tch from SpiderX <spiderx@spiderx.dp.ua> - rscriptd.conf
[stg.git] / projects / stargazer / plugins / store / postgresql / postgresql_store_tariffs.cpp
index 352dab00ba44508c901741d154f0738b666c25bb..7d63b57420cd2f4973f02a29a2413fde10094896 100644 (file)
 #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;
         }