Rounding minutes seems to be fixed ...
This commit is contained in:
parent
2f8c8cab4c
commit
1142efaec2
@ -151,7 +151,7 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
|
|||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
if(money_left <= 0) break;
|
if((int)money_left <= 0) break;
|
||||||
|
|
||||||
// Check year period
|
// Check year period
|
||||||
bool isYearPeriodActive = false;
|
bool isYearPeriodActive = false;
|
||||||
|
@ -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")) {
|
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;
|
struct price_t price;
|
||||||
memset(&price, 0x00, sizeof(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 start_parking_time = start.toSecsSinceEpoch() / 60;
|
||||||
time_t end_parking_time = start_parking_time + 610;
|
time_t end_parking_time = start_parking_time + 610;
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ int main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString duration;
|
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;
|
qDebug() << "GetDurationFromCost() => duration=" << duration;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user