diff --git a/server/templates/logger.html b/server/templates/logger.html index 409679b..efd921c 100644 --- a/server/templates/logger.html +++ b/server/templates/logger.html @@ -15,26 +15,26 @@ timeoutFast = setInterval(dataRefresh, intTime); timeoutSlow = setInterval(fixTables, intTimeSlow); - function fixFloat(actVal, numCount) + function fixFloat(actVal, numDisplay) { - return parseFloat(actVal).toFixed(numCount) + return parseFloat(actVal).toFixed(numDisplay) } function dataRefresh() { // scarico i dati aggioranti $.ajax({url: "/api/v1/channels/all", success: function(result){ - numCount = parseInt(result.DecimalsCount) + numDisplay = parseInt(result.DecimalsDisplay) var divWidth = document.getElementById("divChA").offsetWidth // compilo i dati scaricati $("#SelChannelA").html(result.ChA); - $("#OutputA").html(fixFloat(result.Outs[result.ChA],numCount)); + $("#OutputA").html(fixFloat(result.Outs[result.ChA],numDisplay)); setGaugeA(divWidth,result.Outs[result.ChA],result.Outmin[result.ChA],result.Outmax[result.ChA]); $("#SelChannelB").html(result.ChB); - $("#OutputB").html(fixFloat(result.Outs[result.ChB],numCount)); + $("#OutputB").html(fixFloat(result.Outs[result.ChB],numDisplay)); setGaugeB(divWidth,result.Outs[result.ChB],result.Outmin[result.ChB],result.Outmax[result.ChB]); @@ -42,8 +42,8 @@ $("#ServerTime").html(result.timeSrv); $("#LastSessionName").html(result.LastSessionName); $("#CurrentFolder").html(result.CurrentWorkFolder); - $("#ResultValue").html(result.ResultValue); - $("#RealValue").html(result.RealValue); + $("#ResultValue").html(fixFloat(result.ResultValue,numDisplay)); + $("#RealValue").html(fixFloat(result.RealValue,numDisplay)); $("#Crono").html(result.Crono); if(result.GateOpen == "0")