# Format numbers depending on selected locale

**URL:** <https://meta.discourse.org/t/format-numbers-depending-on-selected-locale/30418>\
**Category:** Feature\
**Tags:** translation, polls\
**Created:** [Juin 24, 2015, 7:22 UTC](https://meta.discourse.org/t/format-numbers-depending-on-selected-locale/30418 "2015-06-24T19:22:52Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [Juin 24, 2015, 7:22 UTC](https://meta.discourse.org/t/format-numbers-depending-on-selected-locale/30418/1 "2015-06-24T19:22:52Z")

</div>

Continuing the discussion from [Is there a way to translate numbers e.g. "1.3K" in the "Views" column?](https://meta.discourse.org/t/is-there-a-way-to-translate-numbers-e-g-1-3k-in-the-views-column/30374/10):

Looking at the code I noticed that numbers aren’t formatted using the locale configured by the user or administrator.  
This can be seen at the reply and view counts. On a German locale it looks like this:

![](https://global.discourse-cdn.com/meta/original/3X/a/a/aa569acf9d1f1183eb58d253242f65e9d9f78867.png)

But it should look like this:  
 ![](https://global.discourse-cdn.com/meta/original/3X/4/b/4b8f408e79f31673da83a9771e49bb7a0952a148.png)

In German we use a comma as decimal separator. And of course, as @downey [already mentioned](https://meta.discourse.org/t/is-there-a-way-to-translate-numbers-e-g-1-3k-in-the-views-column/30374/2) the “K” should be a lowercase “k”. 😉

The missing localization of numbers can also be seen in the poll plugin. The average rating uses the English decimal separator…  
 ![](https://global.discourse-cdn.com/meta/original/3X/c/5/c5045537b3601835b16ebef86ca4560172be45d0.png)

Could we use a library like [FormatJS](http://formatjs.io/) or [Numeral.js](http://numeraljs.com/) in order to format numbers? Looks like not all major browsers support [Intl.NumberFormat](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat) yet. ☹

---

_[View the full topic](https://meta.discourse.org/t/format-numbers-depending-on-selected-locale/30418)._
