Parser tests, part 4

This commit is contained in:
Matt Nadareski
2020-12-20 22:01:05 -08:00
parent 0cf44980a9
commit 7c85d8d661
7 changed files with 101 additions and 19 deletions

View File

@@ -62,6 +62,23 @@ namespace SabreTools.Core.Tools
}
}
/// <summary>
/// Get a sanitized double from an input string
/// </summary>
/// <param name="input">String to get value from</param>
/// <returns>Value as a double?, if possible</returns>
public static double? CleanDouble(string input)
{
double? value = null;
if (input != null)
{
if (Double.TryParse(input, out double doubleValue))
value = doubleValue;
}
return value;
}
/// <summary>
/// Get a sanitized size from an input string
/// </summary>