added more helper methods.
This commit is contained in:
@@ -65,6 +65,11 @@
|
|||||||
input = input.replace(decimalSeparator, ".");
|
input = input.replace(decimalSeparator, ".");
|
||||||
return parseFloat(input);
|
return parseFloat(input);
|
||||||
}
|
}
|
||||||
|
function globalFloatToString(input) {
|
||||||
|
var decimalSeparator = "@numberFormat.NumberDecimalSeparator";
|
||||||
|
input = input.replace(".", decimalSeparator);
|
||||||
|
return input;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@await RenderSectionAsync("Scripts", required: false)
|
@await RenderSectionAsync("Scripts", required: false)
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -99,12 +99,12 @@ function getAndValidateGasRecordValues() {
|
|||||||
}
|
}
|
||||||
if (gasCostType != undefined && gasCostType == 'unit') {
|
if (gasCostType != undefined && gasCostType == 'unit') {
|
||||||
var convertedGasCost = globalParseFloat(gasCost) * globalParseFloat(gasGallons);
|
var convertedGasCost = globalParseFloat(gasCost) * globalParseFloat(gasGallons);
|
||||||
gasCost = convertedGasCost.toFixed(2).toString();
|
if (isNaN(convertedGasCost))
|
||||||
if (isNaN(gasCost))
|
|
||||||
{
|
{
|
||||||
hasError = true;
|
hasError = true;
|
||||||
$("#gasRecordCost").addClass("is-invalid");
|
$("#gasRecordCost").addClass("is-invalid");
|
||||||
} else {
|
} else {
|
||||||
|
gasCost = globalFloatToString(convertedGasCost.toFixed(2).toString());
|
||||||
$("#gasRecordCost").removeClass("is-invalid");
|
$("#gasRecordCost").removeClass("is-invalid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user