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