/** The Base.Util class provide a few utility functions such as number formatting. */ Base.Util = Base.inherits(null, { /** This class property is used on IE to determine which type of ActiveX object * the current version uses, depending on the amount of frogs that fell from the * sky and the amount of hairs under my armpits at this time. */ _ieXMLParser: null, /** The formatNumber() method transforms an integer into a string in which * the integer has commas between each group of thousands. * @param n the value to be formatted */ formatNumber: function (n) { var x = parseInt(n, 10); if (isNaN(x)) { return "N/A"; } if (x < 0) { x = -x; s = '-'; } else { s = ''; } x = x.toString(); var l = x.length, m = l % 3, c = (l - m) / 3, v = ((m > 0) ? x.substr(0, m) : ''), z; for (z=0;z