Using a comma when formatting the score. #8161
PicoAnimate
started this conversation in
General
Replies: 2 comments 1 reply
-
It's always worth considering localizing formatting if your UI can fit it. |
Beta Was this translation helpful? Give feedback.
1 reply
-
You should be able to use double value = 1234.56;
string score = value.ToString("n", CultureInfo.CurrentCulture); If your game provides localization itself where a player can select the language through a menu, you can use the language tag to specify it explicitly like so double value = 1234.56;
string languageTag = "en-US"
string score = value.ToString("n", CultureInfo.GetCultureInfo(languageTag)); The language tags can be seen here https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm hoping to get some answers from Monogame developers in Europe, or India, or even Asia. On my game I am developing I show the game players score at the top of the screen. Currently I am not using a comma to format the number. I am not using a comma, because I know that not all cultures use a comma for formatting when a number is displayed. So I am wondering if anyone thinks I should just omit any comma delimited, or decimal delimited formatting for (Integer values). I know that I can localize my game for a specific culture, however I would prefer not to do that in the first version release of my application.
I found this article which was helpful, however, I am looking for some opinions as to whether I should just ignore numerical formatting of an integer number for the game users score.
https://www.quora.com/Which-countries-other-than-Germany-use-a-comma-in-place-of-the-decimal-point
Beta Was this translation helpful? Give feedback.
All reactions