Safari: enable storage-used number formatting consistent with other browsers

This commit is contained in:
Chris 2015-03-16 22:50:39 -06:00
parent cf3816b494
commit 339ffe9698
1 changed files with 8 additions and 0 deletions

View File

@ -130,6 +130,14 @@ vAPI.closePopup = function() {
/******************************************************************************/
Number.prototype._toLocaleString = Number.prototype.toLocaleString;
Number.prototype.toLocaleString = function() {
// some parts expect comma-formatting; Safari doesn't do it automatically
return this._toLocaleString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
};
/******************************************************************************/
// A localStorage-like object which should be accessible from the
// background page or auxiliary pages.
// This storage is optional, but it is nice to have, for a more polished user