added global parsefloat method which derives from C# culture.
This commit is contained in:
@@ -91,14 +91,14 @@ function getAndValidateGasRecordValues() {
|
||||
} else {
|
||||
$("#gasRecordMileage").removeClass("is-invalid");
|
||||
}
|
||||
if (gasGallons.trim() == '' || parseFloat(gasGallons) <= 0) {
|
||||
if (gasGallons.trim() == '' || globalParseFloat(gasGallons) <= 0) {
|
||||
hasError = true;
|
||||
$("#gasRecordGallons").addClass("is-invalid");
|
||||
} else {
|
||||
$("#gasRecordGallons").removeClass("is-invalid");
|
||||
}
|
||||
if (gasCostType != undefined && gasCostType == 'unit') {
|
||||
var convertedGasCost = parseFloat(gasCost) * parseFloat(gasGallons);
|
||||
var convertedGasCost = globalParseFloat(gasCost) * globalParseFloat(gasGallons);
|
||||
gasCost = convertedGasCost.toFixed(2).toString();
|
||||
if (isNaN(gasCost))
|
||||
{
|
||||
|
||||
@@ -12,12 +12,8 @@ function generateVehicleHistoryReport() {
|
||||
}
|
||||
})
|
||||
}
|
||||
var debounce = null;
|
||||
function updateCheck(sender) {
|
||||
clearTimeout(debounce);
|
||||
debounce = setTimeout(function () {
|
||||
refreshBarChart();
|
||||
}, 1000);
|
||||
function updateCheck() {
|
||||
setDebounce(refreshBarChart);
|
||||
}
|
||||
function refreshMPGChart() {
|
||||
var vehicleId = GetVehicleId().vehicleId;
|
||||
@@ -26,7 +22,7 @@ function refreshMPGChart() {
|
||||
$("#monthFuelMileageReportContent").html(data);
|
||||
})
|
||||
}
|
||||
function refreshBarChart(callBack) {
|
||||
function refreshBarChart() {
|
||||
var selectedMetrics = [];
|
||||
var vehicleId = GetVehicleId().vehicleId;
|
||||
var year = getYear();
|
||||
|
||||
@@ -147,4 +147,11 @@ function decodeHTMLEntities(text) {
|
||||
return $("<textarea/>")
|
||||
.html(text)
|
||||
.text();
|
||||
}
|
||||
var debounce = null;
|
||||
function setDebounce(callBack) {
|
||||
clearTimeout(debounce);
|
||||
debounce = setTimeout(function () {
|
||||
callBack();
|
||||
}, 1000);
|
||||
}
|
||||
@@ -93,7 +93,7 @@ function getAndValidateSupplyRecordValues() {
|
||||
} else {
|
||||
$("#supplyRecordDescription").removeClass("is-invalid");
|
||||
}
|
||||
if (supplyQuantity.trim() == '' || !isValidMoney(supplyQuantity) || parseFloat(supplyQuantity) < 0) {
|
||||
if (supplyQuantity.trim() == '' || !isValidMoney(supplyQuantity) || globalParseFloat(supplyQuantity) < 0) {
|
||||
hasError = true;
|
||||
$("#supplyRecordQuantity").addClass("is-invalid");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user