A game developer falls into the dreaded “number notation” trap of programming

An example of how the notation rule differences between countries can cause bugs in video games.

Written by. Nick Mosier based on the original Japanese article (original article’s publication date: 2021-12-21 17:05 JST)


Japanese solo indie developer THIQXIS tweeted that they’ve been receiving reports of issues from Vietnamese players, and now know why. The root of the problem comes from how different countries use commas and periods when writing numbers. This problem has become something of a hot topic among developers with many expressing their surprise and passing along their sympathy.

When we tried to play THIQXIS’s rhythm game TAKUMI³ on Android, there were no issues when the device was set to English or Japanese. But when trying to play in Vietnamese, we were able to confirm issues with notes not showing up or being stretched horizontally. These issues also occurred when using German. When using French, there was an issue where the song list didn’t show up in the first place.

Gameplay when the device is set to Japanese
Gameplay when the device is set to Vietnamese


The root of the problem is how periods and commas are used to separate numbers. In the United States and Japan, a four-digit number is written like “1,000.00.” But in countries like Vietnam and Germany, the period and comma are switched so it’s written as “1.000,00.” And in France, a space is used, so it would look like “1 000,00.”

If you don’t know the notation in Vietnam, 1,000 would become 1. A human can look at the context and understand what was meant, but a program can’t do that. A program that interprets data using the Japan and United States standard would see “1.000,00” and accept it as just “1.” For example, if an object’s width was set to “1.234” by Japan’s standard, in Vietnamese notation it would be 1,000 times bigger. This is what appears to be happening in TAKUMI³.

Fortunately, it looks like THIQXIS recruited some help and seems to have found a solution. THIQXIS’s tweet also drew a lot of reactions with others chiming in with similar experiences of their own, including looking at estimates received from other countries. It appears that this difference in notation is a worry for accountants and programmers alike. Some people also seem interested in the historic context behind the notation that’s used in Europe also being used in Vietnam.

Pokémon Brilliant Diamond and Pokémon Shining Pearl have also had their own issues over number notation differences across different language settings (related article). In Pokémon BDSP’s case, the in-game calculator would behave strangely depending on the Nintendo Switch’s language settings. Issues with number notation based on language settings may only continue to nag developers in the future.

advertisement