Attached is a patch that adds OpenLayers.Number.format to BaseTypes.js. This new function allow to output numbers with a specified number of decimal places and a customizable thousands and decimal separator. Also an empty string can be used for the separators, which is useful for the thousands separator if it is desired to have none. The separators can either be specified with every function call, or globally by modifying OpenLayers.Number.thousandsSeparator and OpenLayers.Number.decimalSeparator.
Credits: this is a modified version of Tim's formatNumber function in OpenLayers.Control.ScaleBar (#24).