Taximeter fix clientside

This commit is contained in:
Siga
2020-03-13 14:53:49 +01:00
parent 6467615a32
commit 05a95dcb86
4 changed files with 4 additions and 8 deletions

View File

@@ -8,6 +8,7 @@ const PRICE_KM = document.getElementById("taximeter-price-kilometer");
const KILOMETER = document.getElementById("taximeter-kilometer");
function updateKilometer(km) {
lastKilometer = +lastKilometer + +km;
UpdateTotalPrice();
KILOMETER.innerHTML = (Math.round((lastKilometer + Number.EPSILON) * 1000) / 1000).toString();
}
@@ -15,9 +16,8 @@ function updateKilometer(km) {
function UpdateTotalPrice() {
var TotalPrice = +lastKilometer * + price;
console.log(+lastKilometer * + price);
TOTAL_PRICE.innerHTML = Math.floor(TotalPrice).toString();
//mp.trigger("CEF:updateLastPrice", Math.floor(TotalPrice), Math.round((lastKilometer + Number.EPSILON) * 1000) / 1000);
mp.trigger("CEF:updateLastPrice", Math.floor(TotalPrice), Math.round((lastKilometer + Number.EPSILON) * 1000) / 1000);
}
function updateFarePrice() {