I Have some Formulas in Javascript and trying to format them but unable to do that . Here is my JS code from which i am trying to make calculations I have these two variable from which i get input and then make calculations
var pkrusd;
var pkrusd = parseFloat(document.getElementById('txtpkrusd').value, 10);
var ratelb;
ratelb = parseFloat(document.getElementById('txtRatelb').value, 10);
And here are my formulas from which i show results
var res;
res=roundNumber((pkrusd*ratelb)/100.00,2);
document.getElementById('txtF5').value = addCommas(res);
//Per Kg
var perkg=((pkrusd*ratelb)/100.00)*2.20462262184878;
document.getElementById('txtperkg').value=addCommas(roundNumber(perkg,2));
//RS Per Maund
var perMaund=roundNumber((((pkrusd*ratelb)/100.00)*2.20462262184878)*37.3242,2);
document.getElementById('txtperMaund').value=addCommas(perMaund);
Problem is that when i res formula and values pkrusd and ratelb are 91 and 100 and formula for these is (91*100)/100 the result is 91 but i want to set some formating that should be displayed as 91.00 and when values are (91*250)*100 then result is 227.5 but i want to display as 227.50.If there any possibilty for this then please help me to do this