#include <cassert>
#include <cstdlib>
+#include <cmath>
#include "stg/users.h"
#include "stg/common.h"
scriptOnConnect.c_str(),
login.c_str(),
inet_ntostring(currIP).c_str(),
- (double)cash,
+ cash.ConstData(),
id,
dirsStr);
scriptOnDisonnect.c_str(),
login.c_str(),
inet_ntostring(lastIPForDisconnect).c_str(),
- (double)cash,
+ cash.ConstData(),
id,
dirsStr);
struct tm tm;
localtime_r(&t, &tm);
int daysCurrMon = DaysInCurrentMonth();
-double pt = (tm.tm_mday - 1) / (double)daysCurrMon;
+double pt = tm.tm_mday - 1;
+pt /= daysCurrMon;
-passiveTime = (time_t)(pt * 24 * 3600 * daysCurrMon);
+passiveTime = static_cast<time_t>(pt * 24 * 3600 * daysCurrMon);
}
//-----------------------------------------------------------------------------
void USER_IMPL::MidnightResetSessionStat()
double fee = tariff->GetFee() / DaysInCurrentMonth();
-if (fee == 0.0)
+if (std::fabs(fee) < 1.0e-3)
return;
double c = cash;
ResetPassiveTime();
-if (fee == 0.0)
+if (std::fabs(fee) < 1.0e-3)
{
SetPrepaidTraff();
return;