Files
EasySoft-ZenTaoPMS/module/execution/js/storyestimate.ui.js
T
2023-07-27 13:53:47 +08:00

29 lines
680 B
JavaScript

window.updateAverage = function()
{
const $estimates = $('.story-estimate');
if($('.new-estimate').length > 0) $estimates = $('.new-estimate');
var summary = 0;
var count = 0;
var average = 0;
$estimates.each(function()
{
var value = $(this).val();
if(value)
{
value = parseFloat(value);
if(isNaN(value)) value = 0;
summary += value;
count += 1;
}
})
if(count) average = summary / count;
$('#average').val(average.toFixed(2));
}
window.selectRound = function(loadUrl)
{
loadModal(loadUrl.replace('%s', $('input[name="round"]').val()), 'current');
}