Subtract price

This commit is contained in:
Gunnar Skjold
2024-01-23 20:41:56 +01:00
parent bfa1a65dfd
commit 80be1ceef1
6 changed files with 25 additions and 14 deletions

View File

@@ -123,6 +123,9 @@ float PriceService::getValueForHour(uint8_t direction, time_t ts, int8_t hour) {
case PRICE_TYPE_ADD:
ret += pc.value / 10000.0;
break;
case PRICE_TYPE_SUBTRACT:
ret -= pc.value / 10000.0;
break;
case PRICE_TYPE_PCT:
ret += ((pc.value / 10000.0) * ret) / 100.0;
break;