[Plugin: Popular Widget] 4 digit numbers have space not comma every third digit
-
When displaying counts above 1,000 the counts are displayed with a space every 3 digits rather than a comma. So 1 million would be shown as “1 000 000” rather than “1,000,000”. It would be nicer to have the correct format used, and this would also prevent the number from line-breaking which makes it confusing to read. I’ve fixed this by making a single tweak to include.php as below…
On line 241
replace:$output .= '<span class="pop-count">('.preg_replace("/(?<=\d)(?=(\d{3})+(?!\d))/"," ",$post->views).')</span>';
with:$output .= '<span class="pop-count">('.preg_replace("/(?<=\d)(?=(\d{3})+(?!\d))/",",",$post->views).')</span>';
Cheers
- The topic ‘[Plugin: Popular Widget] 4 digit numbers have space not comma every third digit’ is closed to new replies.