`Translator:FormatByKey` should support formatting an integer with a thousands separator

It is currently impossible to use Translator:FormatByKey to format an integer with thousands separators. The wiki has a specification for numbers with decimal places, but not integers.

Why this is an issue

This comes a lot when trying to communicate large discrete values to the user. For example, money is my game does not have cents, so I do not wish to show decimal places. However, players may have large amounts of money, so I do want comma separated values.

Preferred solution

My preferred solution is that the {1:num} specifier allow the number of decimals to be specified, since 2 decimal places feels very hard-coded. This has the additional benefit of solving the issue where more precise decimal places may be displayed to the user.

Why it matters

This will help with translating my game to other languages. Otherwise, I’m causing a regression in the way numbers are displayed to users.

10 Likes

Ideally, this would automatically handle the different types of commas in languages. Example: In English, we might say “100,000” (one hundred thousand). In German, it’s “100.000”. In the Indian numbering system, it’s “1,00,000”.

1 Like

Yes! Exactly! It currently supports this for numbers (with 2 decimal places), but not for integers.

2 Likes

Ran into this issue when testing localization for Welcome to Bloxburg.

Just like the OP, I’m trying to display comma separated large integers. Using {1:num} doesn’t work, as there’s no reason to always include decimals for such values.

4 Likes