Separating higher numbers – solution
-
Hi everyone, I did little improvements for my friends so can share if someone need it
– By default, numbers are shown as 12344568, 1234 etc, if you want numbers display as 1 234 567, 1 234 you can add this code:
1, open /public/js/corona-virus-data-public.js
2, add function on line 6
$.fn.digits = function(){ return this.each(function(){ $(this).text( $(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1 ") ); }) }
3, then add
.digits();
to every line with appendcode hint: https://pasteboard.co/J4lTBb6.png
result: https://pasteboard.co/J4lUkuu.png
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Separating higher numbers – solution’ is closed to new replies.