I've read that before. I dunno ... it may certainly be the design intention, but it still feels like a hack to me.
On another note, this is the latest incarnation
public double ToPositiveDouble(string input, double def = 1){
double dv;
return (Double.TryParse(input, out dv) && dv>0) ? dv : def;
}
The way I see it, it does all of the requisite things and returns a positive value greater than 0 or the default value if the input cannot be converted to a positive value.
I really think I am spending WAY too much time on such a trivial function