Click here to Skip to main content
14,737,375 members
Home » Discussions » Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Ad Hoc routing protocol Pin
Richard MacCutchan18-Apr-13 5:27
mveRichard MacCutchan18-Apr-13 5:27 
GeneralRe: Ad Hoc routing protocol Pin
3bood.ghzawi18-Apr-13 6:09
Member3bood.ghzawi18-Apr-13 6:09 
GeneralRe: Ad Hoc routing protocol Pin
Richard MacCutchan18-Apr-13 6:42
mveRichard MacCutchan18-Apr-13 6:42 
GeneralRe: Ad Hoc routing protocol Pin
3bood.ghzawi19-Apr-13 1:05
Member3bood.ghzawi19-Apr-13 1:05 
GeneralRe: Ad Hoc routing protocol Pin
Richard MacCutchan19-Apr-13 1:38
mveRichard MacCutchan19-Apr-13 1:38 
GeneralRe: Ad Hoc routing protocol Pin
Joe Woodbury24-Apr-13 9:22
professionalJoe Woodbury24-Apr-13 9:22 
GeneralRe: Ad Hoc routing protocol Pin
Richard MacCutchan24-Apr-13 10:30
mveRichard MacCutchan24-Apr-13 10:30 
QuestionDisplay only 2 digs in string in label. Pin
Søren Lyder Nielsen18-Apr-13 0:50
MemberSøren Lyder Nielsen18-Apr-13 0:50 
Hey.


I am trying to get my program to display only 2 decimals of the result og an calculation.

Code:
// Defination af input
             dansk = System::Convert::ToDouble(textBox2->Text);
             kurs = System::Convert::ToDouble(numericUpDown1->Text);

             // Udregningerne
             tysk = dansk / kurs;
             ti = tysk * 0.90;
             femten = tysk * 0.85;
             tyve = tysk * 0.82;
             bdansk = tysk * kurs * 1.25;
             bti = tysk * 0.90 * 1.25;
             bfemten = tysk * 0.85 * 1.25;
             btyve = tysk * 0.82 * 1.25;
             btysk = tysk * 1.18;

             //konvertering til udskrivning af resultat
             label7->Text = System::Convert::ToString(dansk) + " Kr";
             label8->Text = System::Convert::ToString(ti) + " Kr";
             label9->Text = System::Convert::ToString(femten) + " Kr";
             label10->Text = System::Convert::ToString(tyve) + " Kr";
             label14->Text = System::Convert::ToString(bdansk) + " Kr";
             label15->Text = System::Convert::ToString(bti) + " Kr";
             label16->Text = System::Convert::ToString(bfemten) + " Kr";
             label17->Text = System::Convert::ToString(btyve) + " Kr";
             label20->Text = System::Convert::ToString(tysk) + " Eur";
             label21->Text = System::Convert::ToString(btysk) + " Eur";


My ints are defined another place in my prpgram.

Right now my result will be something like 54.867563547, and not 54.86, as my wish is.

Can you help ?
AnswerRe: Display only 2 digs in string in label. Pin
Richard MacCutchan18-Apr-13 2:46
mveRichard MacCutchan18-Apr-13 2:46 
GeneralRe: Display only 2 digs in string in label. Pin
Søren Lyder Nielsen18-Apr-13 4:30
MemberSøren Lyder Nielsen18-Apr-13 4:30 
GeneralRe: Display only 2 digs in string in label. Pin
Richard MacCutchan18-Apr-13 5:24
mveRichard MacCutchan18-Apr-13 5:24 
GeneralRe: Display only 2 digs in string in label. Pin
Søren Lyder Nielsen22-Apr-13 23:50
MemberSøren Lyder Nielsen22-Apr-13 23:50 
GeneralRe: Display only 2 digs in string in label. Pin
Richard MacCutchan23-Apr-13 0:03
mveRichard MacCutchan23-Apr-13 0:03 
GeneralRe: Display only 2 digs in string in label. Pin
Søren Lyder Nielsen23-Apr-13 1:09
MemberSøren Lyder Nielsen23-Apr-13 1:09 
GeneralRe: Display only 2 digs in string in label. Pin
Richard MacCutchan23-Apr-13 2:52
mveRichard MacCutchan23-Apr-13 2:52 
GeneralRe: Display only 2 digs in string in label. Pin
Søren Lyder Nielsen23-Apr-13 3:26
MemberSøren Lyder Nielsen23-Apr-13 3:26 
GeneralRe: Display only 2 digs in string in label. Pin
Richard MacCutchan23-Apr-13 3:28
mveRichard MacCutchan23-Apr-13 3:28 
GeneralRe: Display only 2 digs in string in label. Pin
Søren Lyder Nielsen23-Apr-13 3:32
MemberSøren Lyder Nielsen23-Apr-13 3:32 
GeneralRe: Display only 2 digs in string in label. Pin
Richard MacCutchan23-Apr-13 4:55
mveRichard MacCutchan23-Apr-13 4:55 
GeneralRe: Display only 2 digs in string in label. Pin
Søren Lyder Nielsen23-Apr-13 5:42
MemberSøren Lyder Nielsen23-Apr-13 5:42 
GeneralRe: Display only 2 digs in string in label. Pin
Richard MacCutchan23-Apr-13 5:49
mveRichard MacCutchan23-Apr-13 5:49 
AnswerRe: Display only 2 digs in string in label. Pin
Member 1000269911-May-13 1:46
MemberMember 1000269911-May-13 1:46 
GeneralRe: Display only 2 digs in string in label. Pin
Richard MacCutchan11-May-13 5:10
mveRichard MacCutchan11-May-13 5:10 
QuestionC++ Windows Form Application Printing Pin
eakteam16-Apr-13 11:37
professionaleakteam16-Apr-13 11:37 
AnswerRe: C++ Windows Form Application Printing Pin
NotPolitcallyCorrect16-Apr-13 13:01
MemberNotPolitcallyCorrect16-Apr-13 13:01 

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.