Hi, I think this method of the global object was introduced back with 1.75, but doesn't appear to have made it as far as the wiki.
Is the text below a correct description of syntax? If so I'll add it to the wiki...
function formatCredits(credits : Number [,deciCredits : Boolean][,currencySymbol : Boolean]) : String
Returns a string with the credit value. If deciCredits is true the number will be formatted to 1 decimal place. If currencySymbol is true the string will terminate with the ₢ symbol.
Actually the ₢ is not fixed but can be overwritten with an other currency symbol in a localised version. The symbol is stored in 'descriptions.plist' under the key '@-credits'. That is why using this method of adding the currency symbol is better than the hardcoded way. Having said that, I must admit, I always hardcoded the currency symbols in my oxps.
Same is true for format integer. Formats can be localised with: number-decimal-separator and number-group-separator
For the wiki it would be enough to mention that formatting follows the localisation rules.
Actually the ₢ is not fixed but can be overwritten with an other currency symbol in a localised version.
In fact, formatCredits() is in JS specifically so that it can be overridden to display credits in completely different ways, if necessary, for localization OXPs.