You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The unit tests only worked on the build server in the US, but not on our Dutch machines. This turns out to be caused by code that does not account for localization, especially where objects are converted to strings and vice versa.
To Reproduce
The code contains constructs like the following:
Convert.ChangeType(object, Type), where the object can be a string, and the Type a decimal. In a non-US locale like the Netherlands, Convert.ChangeType("7.0", typeof(decimal)) will result in the decimal 70M, not 7.0M
ToString() is called on objects. This will almost always fail. I.e. 18.55.ToString() = "18,55" (COMMA!) in the Netherlands.
Interpolation strings like $"{someDecimal}" are used, which causes the same problems as above.
Methods like "decimal.TryParse()" are used, which will also not work.
We will need to find all places in the code where this happens. Probably mostly the parse/ToString() routines of the Cql datatypes.
The text was updated successfully, but these errors were encountered:
Just calling parse and ToString() also means that the rules for the actual syntax are not enforced, e.g. StringToDecimal does not enforce any rules on the format of the string currently.
Describe the bug
The unit tests only worked on the build server in the US, but not on our Dutch machines. This turns out to be caused by code that does not account for localization, especially where objects are converted to strings and vice versa.
To Reproduce
The code contains constructs like the following:
Convert.ChangeType(object, Type)
, where the object can be a string, and the Type a decimal. In a non-US locale like the Netherlands,Convert.ChangeType("7.0", typeof(decimal))
will result in the decimal 70M, not 7.0MToString()
is called on objects. This will almost always fail. I.e. 18.55.ToString() = "18,55" (COMMA!) in the Netherlands.We will need to find all places in the code where this happens. Probably mostly the parse/ToString() routines of the Cql datatypes.
The text was updated successfully, but these errors were encountered: