Is your conversion code running after clearing the
textboxes
too.
I think after clearing the
textbox
the conversion is happening and is giving exception.
I suggest use of
Double.TryParse
just to make it little robust. and before trying to convert check whether the
textboxes
are empty or filled with some value.
i.e.
if(textbox1.Text != string.Empty)
{
double days = Double.TryParse(textbox1.Text);
}