fix ocpp pricing to only 3 decimal degits
MODIFY
src/server/ocpp/utils/OCPPUtils.ts
src/server/ocpp/utils/OCPPUtils.ts
@@ -220,7 +220,7 @@ export default class OCPPUtils {
} else {
consumption.cumulatedAmount = Utils.truncTo(transaction.currentCumulatedPrice + consumption.amount, 6);
}
- transaction.currentCumulatedPrice = consumption.cumulatedAmount;
+ transaction.currentCumulatedPrice = parseFloat(consumption.cumulatedAmount.toFixed(3));
}
break;
// Stop Transaction
@@ -238,7 +238,7 @@ export default class OCPPUtils {
} else {
consumption.cumulatedAmount = Utils.truncTo(transaction.currentCumulatedPrice + consumption.amount, 6);
}
- transaction.currentCumulatedPrice = consumption.cumulatedAmount;
+ transaction.currentCumulatedPrice = parseFloat(consumption.cumulatedAmount.toFixed(3));
// Update Transaction
if (!transaction.stop) {
transaction.stop = {} as TransactionStop;

fix ocpp pricing to only 3 decimal degits