Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
AnswerRe: Image Encryption Pin
OriginalGriff20-Mar-12 5:40
mveOriginalGriff20-Mar-12 5:40 
QuestionMortgage Calculator Error Pin
Xonel20-Mar-12 3:32
Xonel20-Mar-12 3:32 
AnswerRe: Mortgage Calculator Error Pin
PIEBALDconsult20-Mar-12 3:37
mvePIEBALDconsult20-Mar-12 3:37 
GeneralRe: Mortgage Calculator Error Pin
Xonel20-Mar-12 3:44
Xonel20-Mar-12 3:44 
AnswerRe: Mortgage Calculator Error Pin
ZurdoDev20-Mar-12 4:33
professionalZurdoDev20-Mar-12 4:33 
AnswerRe: Mortgage Calculator Error Pin
JF201520-Mar-12 3:48
JF201520-Mar-12 3:48 
GeneralRe: Mortgage Calculator Error Pin
Xonel20-Mar-12 3:55
Xonel20-Mar-12 3:55 
AnswerRe: Mortgage Calculator Error Pin
V.20-Mar-12 3:54
professionalV.20-Mar-12 3:54 
There are many things wrong here.
C#
Convert.ToDouble
will work and is preferable of
C#
(double)somevalue
but the best method is
C#
double.TryParse or int.TryParse


Secondly you need to use
C#
txtPayment.Text = payment.ToString();
and make sure payment is not null.
If you do want an integer, you need to indeed first cast the double to an integer and then that integer to a string (or use round and floor functions)


Why do you cast to double in these cases?
C#
double interestRate = (double)udInterest.Value / 100;  // calculate interest from 100%
double termOfLoan = (double)(udTerm.Value * 12); // monthly term


What is this code for? Own project, a book, homework?
V.

GeneralRe: Mortgage Calculator Error Pin
DaveyM6920-Mar-12 5:08
professionalDaveyM6920-Mar-12 5:08 
GeneralRe: Mortgage Calculator Error Pin
V.20-Mar-12 6:20
professionalV.20-Mar-12 6:20 
GeneralRe: Mortgage Calculator Error Pin
PIEBALDconsult20-Mar-12 6:07
mvePIEBALDconsult20-Mar-12 6:07 
GeneralRe: Mortgage Calculator Error Pin
BobJanova21-Mar-12 3:21
BobJanova21-Mar-12 3:21 
QuestionProgram to find color of the pixels being selected in a picture Pin
Supztermc20-Mar-12 1:54
Supztermc20-Mar-12 1:54 
AnswerRe: Program to find color of the pixels being selected in a picture Pin
Pete O'Hanlon20-Mar-12 2:07
mvePete O'Hanlon20-Mar-12 2:07 
GeneralRe: Program to find color of the pixels being selected in a picture Pin
Supztermc20-Mar-12 2:10
Supztermc20-Mar-12 2:10 
GeneralRe: Program to find color of the pixels being selected in a picture Pin
Pete O'Hanlon20-Mar-12 2:48
mvePete O'Hanlon20-Mar-12 2:48 
GeneralRe: Program to find color of the pixels being selected in a picture Pin
wizardzz20-Mar-12 5:40
wizardzz20-Mar-12 5:40 
GeneralRe: Program to find color of the pixels being selected in a picture Pin
BobJanova21-Mar-12 3:28
BobJanova21-Mar-12 3:28 
Questionrefer to MdiParent by name Pin
Jassim Rahma20-Mar-12 1:11
Jassim Rahma20-Mar-12 1:11 
AnswerRe: refer to MdiParent by name Pin
Shameel20-Mar-12 1:30
professionalShameel20-Mar-12 1:30 
GeneralRe: refer to MdiParent by name Pin
Jassim Rahma20-Mar-12 3:15
Jassim Rahma20-Mar-12 3:15 
GeneralRe: refer to MdiParent by name Pin
Pete O'Hanlon20-Mar-12 3:25
mvePete O'Hanlon20-Mar-12 3:25 
GeneralRe: refer to MdiParent by name Pin
Shameel20-Mar-12 8:08
professionalShameel20-Mar-12 8:08 
AnswerRe: refer to MdiParent by name Pin
Abhinav S20-Mar-12 3:10
Abhinav S20-Mar-12 3:10 
GeneralRe: refer to MdiParent by name Pin
Jassim Rahma20-Mar-12 21:30
Jassim Rahma20-Mar-12 21:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.