You can use
.toFixed()
[
^] here to get the desired output and also use a generic function to reuse the code again like:
function Calculate() {
var textBoxNumPatInt = document.getElementById('<%= TextBoxNumPatInt.ClientID%>').value;
var textBoxNumMinDoc = document.getElementById('<%= TextBoxNumMinDoc.ClientID%>').value;
if ((textBoxNumPatInt !== "") && (textBoxNumMinDoc !== "")) {
var newValue = GetDecimalValue(textBoxNumMinDoc) / GetDecimalValue(textBoxNumPatInt);
document.getElementById('<%= TextBoxAvgTimeMedRec.ClientID%>').value = GetDecimalValue(newValue);
}
}
function GetDecimalValue(value) {
return (value ? parseFloat(value).toFixed(2) : 0.00);
}
Hope this helps!