From ba33e28675af747559762dcc9b5d27bed323cd57 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 18 Dec 2013 22:41:55 +0000 Subject: [PATCH] change digits function to use unicode 'thin space' as thousands seperator --- code/utils_misc.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index ef30baba..09f8b7cc 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -122,7 +122,9 @@ window.convertCookieToLocalStorage = function(name) { // add thousand separators to given number. // http://stackoverflow.com/a/1990590/1684530 by Doug Neiner. window.digits = function(d) { - return (d+"").replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1 "); + // U+2009 - Thin Space. Recommended for use as a thousands separator... + // https://en.wikipedia.org/wiki/Space_(punctuation)#Table_of_spaces + return (d+"").replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1 "); }