Formats number according to user's locale

This commit is contained in:
Vlad
2017-12-13 21:35:49 -05:00
parent 51cde55217
commit ebcc094b4d
2 changed files with 4 additions and 2 deletions

View File

@@ -20,7 +20,8 @@ define(['react', 'classnames'], (React, classNames) => {
href="javascript:;"
className={classes}
onClick={this.handleSelect.bind(this, group.name)} >
{group.label} <span className="count">({ group.count.toLocaleString() })</span>
{group.label}
<span className="count">({ parseInt(group.count, 10).toLocaleString() })</span>
</a>
</li>
);

View File

@@ -168,8 +168,9 @@ define([
numberOfItemsLabel = MailPoet.I18n.t('numberOfItemsSingular');
} else {
numberOfItemsLabel = MailPoet.I18n.t('numberOfItemsMultiple')
.replace('%$1d', this.props.count.toLocaleString());
.replace('%$1d', parseInt(this.props.count, 10).toLocaleString());
}
return (
<div className={classes}>
<span className="displaying-num">{ numberOfItemsLabel }</span>