Span decimal point precision
Styling and readability

Your indentation is inconsistent. This can lead to developers wrongly assuming code belongs to a different block. I would recommend fixing this for all code.

Your use of whitespace is inconsistent. You sometimes use a space after a comma, you sometimes do not. You sometimes use spaces around operators, you sometimes do not.

Re-inventing the wheel

Your function roundNumber is somewhat re-inventing the wheel. You are basically recreating the toFixed function with a cast back to a number.



function roundNumber(num, places) {
  return Math.round(num * Math.pow(10, places)) / Math.pow(10, places);
}

function roundNumberFixed(num, places) {
  return Number(num).toFixed(places);
}

function roundNumberFixedAsNumber(num, places) {
  return Number(Number( num ).toFixed(places));
}

function test(num, places) {
  console.log("== Testing with", num, "and", places, "==");
  console.log(roundNumber(num, places));
  console.log(roundNumberFixed(num, places) );
  console.log(roundNumberFixedAsNumber(num, places));  
}

var testvalues = [["1.234567", 3],
                  [" 1      ", 2],
                  ["123512.2", 2],
                  ["-55.2121", 5],
                  ["13.223  ", 1]];
console.log("=== Starting tests ===");
for(i in testvalues) {
  test(testvalues[i][0], testvalues[i][1]);
}




You seem to be using jQuery. You can use .each (docs) to loop over all elements in an jQuery object. Similarly, you can use .html (docs) to change the innerHTML of an element.

Termination of loop on referenceError

You use a while loop without a way of terminating it. It actually terminates, because you try to modify the innerHTML of undefined. That's... silly.