Rounding minutes seems to be fixed ...

This commit is contained in:
Moran Rod 2023-05-14 16:15:37 +02:00
parent 2f8c8cab4c
commit 1142efaec2
2 changed files with 3 additions and 3 deletions

View File

@ -151,7 +151,7 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
while(true)
{
if(money_left <= 0) break;
if((int)money_left <= 0) break;
// Check year period
bool isYearPeriodActive = false;

View File

@ -34,7 +34,7 @@ int main() {
if (init_tariff(&tariff, "C:\\Users\\MROD\\Documents\\QtCreator\\build-MOBILISIS-Calculator-Desktop_Qt_5_12_12_MSVC2017_32bit-Debug\\main\\etc\\psa_tariff\\zone1.json")) {
struct price_t price;
memset(&price, 0x00, sizeof(price));
QDateTime start = QDateTime::fromString("2023-05-11T07:50:00",Qt::ISODate); //QDateTime::currentDateTime();
QDateTime start = QDateTime::fromString("2023-05-12T15:00:34",Qt::ISODate); //QDateTime::currentDateTime();
time_t start_parking_time = start.toSecsSinceEpoch() / 60;
time_t end_parking_time = start_parking_time + 610;
@ -46,7 +46,7 @@ int main() {
}
QString duration;
if(compute_duration_for_parking_ticket(tariff,start_parking_time,1525,duration))
if(compute_duration_for_parking_ticket(tariff,start_parking_time,188,duration))
{
qDebug() << "GetDurationFromCost() => duration=" << duration;
}