Number Formatting

In Portuguese, the decimal separator is a comma (",") and the thousands separator is a dot ("."). To handle the dot and comma in Portuguese localization we will use the C# feature of Globalization.

If your game displays dot(.) (eg. points : 1.2) in game UI then you have to do it, if not please skip this part.

We will send two key “localeLanguage” and “countryIso2Code” in the game config that you will receive in the SetUpGame event.

You can fetch it like this:

String localeLanguage = 
   configdata[IntegrationEvents.localeLanguage].ToString();
String countryIso2Code = 
   configdata[IntegrationEvents.countryIso2Code].ToString();

Example. localLanguage = “pt” , countryIso2Code = “BR”; How to use it:

string formatter = localeLanguage + "-" +     
countryIso2Code;

o/p => “pt-BR” var num = 12.345f;

var output = num.ToString("G", 
CultureInfo.CreateSpecicCulture(formatter));

o/p => 12,345;

Last updated