You need to check against bval < 0; it may be nonsensical for the user to have set a negative value, but it should be handled gracefully.  Note that DoubleFromString represents a percentage as a negative value (so it reads "-30" and "30%" identically); if you want to give meaning to percentages (I'm not sure how you're going to discover the total available bandwidth, but) this is the place to do it.  Otherwise, you need to reject negative values here (and in the second copy of this code, below).