Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions source/Assets/Scripts/InfinarioSDK/Infinario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ private Infinario()
{
//Prepare for wrappers
implementation = new SDK.Unity ();

//Setup decimal separator for numbers
var customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation here (spaces) does not match the surrounding code (tabs). Please use tabs so the formatting is consistent.

customCulture.NumberFormat.NumberDecimalSeparator = ".";
System.Threading.Thread.CurrentThread.CurrentCulture = customCulture;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't change a thread's culture from within the SDK, there are two reasons for that:

  • You may affect the host application, which may have set their own culture
  • The SDK runs in multiple threads and you are changing the culture for only one of them

Please use the correct Culture explicitly at the place where the string gets formatted. You want to use CultureInfo.InvariantCulture as the culture as it already has . as the decimal separator. I'm not sure about thousands separator though, please check that.

}

public static Infinario GetInstance()
Expand Down