Merge: + client: add digit grouping for numbers on the dashboard

Closes 

Squashed commit of the following:

commit 6e5de427c48577ebbe4d963f817b66fed9b29bb4
Author: Ildar Kamalov <i.kamalov@adguard.com>
Date:   Wed Mar 11 17:56:39 2020 +0300

    + client: add digit grouping for numbers on the dashboard
This commit is contained in:
Ildar Kamalov 2020-03-17 15:15:19 +03:00
parent bc9bccc669
commit e5db33705d
4 changed files with 41 additions and 12 deletions
client/src/helpers

View file

@ -449,3 +449,12 @@ export const getCurrentFilter = (url, filters) => {
return { name: '', url: '' };
};
/**
* @param number Number to format
* @returns string Returns a string with a language-sensitive representation of this number
*/
export const formatNumber = (num) => {
const currentLanguage = i18n.languages[0] || DEFAULT_LANGUAGE;
return num.toLocaleString(currentLanguage);
};