Hi ied206,
We need a fixed (hardcoded) rule for decimal mark.
We had used dot ( . ) as decimal mark on plugins but one day a user came and decimal mark ( . ) did not work.
(a topic somewhere on http://theoven.org ... )
It seems decimal mark changed by hostos settings somehow effect old builder at one special hostos setting.
So we had to update plugins that are affected and create a Macro at Macro Library to overcome such situations.
PEBakery follows solution 1a.
Reason: C#'s language-neutral number parsing is based on English, which allows '.' in decimal mark.
This snnipet is a code used in PEBakery to parse decimal number.
public static bool ParseDecimal(string str, out decimal value)
{
if (str.Equals(string.Empty, StringComparison.Ordinal))
{
value = 0;
return false;
}
if (str.StartsWith("0x", StringComparison.OrdinalIgnoreCase))
{
bool result = ulong.TryParse(str.Substring(2), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out ulong intValue);
value = (decimal)intValue;
return result;
}
else
{
return decimal.TryParse(str, NumberStyles.AllowDecimalPoint | NumberStyles.Integer, CultureInfo.InvariantCulture, out value);
}
}
MSDN article clarifies:
The invariant culture is culture-insensitive; it is associated with the English language but not with any country/region.