* @param {Number} decimals number of decimal places
* @return {String} The formatted currency string
*/
- number : function(v,decimals)
+ number : function(v, decimals, thousandsDelimiter = ',')
{
// multiply and round.
decimals = typeof(decimals) == 'undefined' ? 2 : decimals;
var ps = v.split('.');
var whole = ps[0];
-
var r = /(\d+)(\d{3})/;
// add comma's
while (r.test(whole)) {
- whole = whole.replace(r, '$1' + ',' + '$2');
+ whole = whole.replace(r, '$1' + thousandsDelimiter + '$2');
}