The culture settings of InRule are saved with a baseline of default English (United States) settings. At runtime or during authoring, the culture-specific formatting for dates, datetimes, and numbers are translated into the Windows settings defined by the user session for the operating system. This is true throughout InRule for the rule authoring in irAuthor, rule testing in irVerify, and rule execution in irServer.
Generally speaking, a user can author rules in Europe and see the formats displayed that are specific to European users. When that rule application is saved, InRule translates relevant data to the assumed English (United States) default for storage. Opening the rule application in a different Windows setting will result in those relevant formats being translated from the English (United States) baseline into the culture settings of the current user. This allows for portability of the rules/entity model (rule application) and provides independence from conflicting user settings.
Some authoring considerations for Dates, DateTimes and Numbers are as follows:
- Multiple argument functions require quotes around European formatted numbers because comma is the separator for function arguments. For example, Round(number,digits) in European format must be entered as Round(‘1000,987’,2). The English (United States) default equivalent is Round(1000.987,2).
- Data stored as date, datetime, or number types will display in culture specific settings in inline tables. Date/datetime/number values stored in a Text type column are not adjusted per culture setting.
Since the culture specific settings of InRule are adopted from the user settings by default, the culture formats can be overridden at the thread level using .NET class libraries. By overriding the culture settings of the thread, developers can serve the culture settings to InRule calls. Sample source code for overriding the thread culture to English-United Kingdom is as follows:
CultureInfo newCulture = new CultureInfo("en-GB");
Thread.CurrentThread.CurrentCulture = newCulture;