stats: Remove complex regex badly implementing toLocaleString.

This regular expression to add commas to a large number is hard to
read and produces less useful output than using the standard browser
API for doing this.

Fixes #20416.
This commit is contained in:
Aini-Alem Robertson 2021-12-02 19:46:43 +00:00 committed by Tim Abbott
parent fc8db93f36
commit e9d80390cc
1 changed files with 1 additions and 1 deletions

View File

@ -593,7 +593,7 @@ function populate_messages_sent_by_message_type(data) {
for (let i = 0; i < plot_data.labels.length; i += 1) {
labels.push(plot_data.labels[i] + " (" + plot_data.percentages[i] + ")");
}
const total_string = plot_data.total.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
const total_string = plot_data.total.toLocaleString();
return {
trace: {
values: plot_data.values,