Allow , instead of . for decimal separator

This commit is contained in:
UnknownShadow200 2017-02-20 10:34:45 +11:00
parent c61a746555
commit 15df620951

View File

@ -101,6 +101,7 @@ namespace MCGalaxy {
// Not all languages use . as their decimal point separator
public static bool TryParseDecimal(string s, out float result) {
if (s.IndexOf(',') >= 0) s = s.Replace(',', '.');
result = 0;
float temp;
const NumberStyles style = NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite