Edit in JSFiddle

function addExtraZeroes( num ) {
    var value = Number(num);
    var res = num.split(".");
    if(num.indexOf('.') === -1) {
        value = value.toFixed(2);
        num = value.toString();
    } else if (res[1].length < 3) {
        value = value.toFixed(2);
        num = value.toString();
    }
    return num
}

var firstVal= '99'
var secondVal= '99.0'
var thirdVal= '99.00'

document.getElementById('firstBefore').innerHTML = firstVal;
document.getElementById('firsAfter').innerHTML = addExtraZeroes(firstVal);
document.getElementById('secondBefore').innerHTML = secondVal;
document.getElementById('secondAfter').innerHTML = addExtraZeroes(secondVal);
document.getElementById('thirdBefore').innerHTML = thirdVal;
document.getElementById('thirdAfter').innerHTML = addExtraZeroes(thirdVal);
<h4>
Test With 99
</h4>
Before: <span id='firstBefore'></span> After: <span id='firsAfter'></span>

<h4>
Test With 99.0
</h4>
Before: <span id='secondBefore'></span> After: <span id='secondAfter'></span>

<h4>
Test With 99.00
</h4>
Before: <span id='thirdBefore'></span> After: <span id='thirdAfter'></span>