Skip to content

Instantly share code, notes, and snippets.

@kepek
Created April 20, 2014 16:10
Show Gist options
  • Save kepek/11117836 to your computer and use it in GitHub Desktop.
Save kepek/11117836 to your computer and use it in GitHub Desktop.
(function () {
var language = {
delimiters: {
thousands: ',',
decimal: '.'
},
abbreviations: {
thousand: 'k',
million: 'm',
billion: 'b',
trillion: 't'
},
ordinal: function (number) {
var b = number % 10;
return (~~ (number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
},
currency: {
symbol: '£'
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = language;
}
// Browser
if (typeof window !== 'undefined' && this.numeral && this.numeral.language) {
this.numeral.language('en-gb', language);
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment