Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
DateTime dt1 = Calendar2.SelectedDate;
            DateTime dt2 = Calendar1.SelectedDate;
            TimeSpan ts = dt1 - dt2;           
            double days = ts.Days;
            txtDays.Text = days.ToString();
            double res = days - 1;
            double amt = Convert.ToDouble(txtAmt.Text);
            double res1 = amt * res;
            double amtperday = Convert.ToDouble(txtAmtPerDay.Text);
            double res2 = days * amtperday;
            double tot = res1 + res2;
            txtTotAmt.Text = tot.ToString();
Posted 24-Feb-13 0:26am
Edited 24-Feb-13 2:15am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use Double.TryParse Method (String, Double%)[^] method instead of Convert.ToDouble Method (String)[^].
 
My personal opinion: As I looked into your previous questions, it is very sad, that you are using CP instead of trying to google first.
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 12-Mar-13 15:35pm
   
Agree, a 5.
OP re-posted this exact question again, which is the abuse. We need to report accounts for systematic abuse like that.
OP also posted two fake answers. I'm not going to report it to the abuse watch forum just yet, because forum votes may easily ban the account, but I want just warn Gilbertinino.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 24 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100