Merge pull request #245 from jcperea/fix/numberGroupSeparator

fix(localize): update the way to obtain the group separator for a number
This commit is contained in:
Joren Broekema 2019-08-15 10:54:33 +02:00 committed by GitHub
commit f3e71003e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -12,6 +12,6 @@ export function getGroupSeparator(locale) {
const formattedNumber = Intl.NumberFormat(computedLocale, {
style: 'decimal',
minimumFractionDigits: 0,
}).format('1000');
return normalSpaces(formattedNumber[1]);
}).format('10000');
return normalSpaces(formattedNumber[2]);
}

View file

@ -7,5 +7,6 @@ describe('getGroupSeparator', () => {
expect(getGroupSeparator('en-GB')).to.equal(',');
expect(getGroupSeparator('nl-NL')).to.equal('.');
expect(getGroupSeparator('fr-FR')).to.equal(' ');
expect(getGroupSeparator('es-ES')).to.equal('.');
});
});