public static float?StringToNullableFloat(string str) { if (StringFloatDeterminer.Is(str)) { return(StringFloatDeterminer.To(str)); } return(null); }
public static float ObjectToFloat(object obj, float defaultVal = 0F) { if (obj is null) { return(defaultVal); } if (obj is float myself) { return(myself); } if (obj is string str) { return(StringToFloat(str, defaultVal)); } return(StringFloatDeterminer.To(obj.ToString(), defaultVal)); }
public static float StringToFloat(string str, params IConversionImpl <string, float>[] impls) { return(StringFloatDeterminer.To(str, impls)); }
public static float StringToFloat(string str, float defaultVal = default) { return(StringFloatDeterminer.To(str, defaultVal)); }