<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Umwandlung und Kommastellenproblem]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe eine MFC-Anwendung erstellt und habe nun folgende Probleme. Ich habe einen float-Wert, doch bei Eingabe des Wertes 10.10 wird dann nach der Übernahme dieses Wertes in ein anderes Feld der Wert 10.1 angezeigt, ich möchte aber generell immer mindestens, am liebsten auch maximum, 2 Nachkommastellen angezeigt haben, selbst wenn die zweite Nachkommastelle eine 0 ist. Was muss ich dazu tun oder welche Tricks gibt es ?</p>
<p>Das zweite Problem, dass ich dann habe ist, dass ich einen float Wert in einen CString bekommen muss, doch wie kann ich diesen am besten und unkompliziertesten umwandeln ?</p>
<p>Bsp : m_GesamtString = m_String1 + m_String2 + &quot;\t&quot; + m_Floatwert;</p>
<p>So geht es ja nicht, klar, aber wie dann ?</p>
<p>Vielen Dank !</p>
<p>mfg<br />
Alex</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/59625/umwandlung-und-kommastellenproblem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 03 Jun 2026 01:13:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/59625.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 26 Dec 2003 09:02:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Umwandlung und Kommastellenproblem on Fri, 26 Dec 2003 09:02:02 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe eine MFC-Anwendung erstellt und habe nun folgende Probleme. Ich habe einen float-Wert, doch bei Eingabe des Wertes 10.10 wird dann nach der Übernahme dieses Wertes in ein anderes Feld der Wert 10.1 angezeigt, ich möchte aber generell immer mindestens, am liebsten auch maximum, 2 Nachkommastellen angezeigt haben, selbst wenn die zweite Nachkommastelle eine 0 ist. Was muss ich dazu tun oder welche Tricks gibt es ?</p>
<p>Das zweite Problem, dass ich dann habe ist, dass ich einen float Wert in einen CString bekommen muss, doch wie kann ich diesen am besten und unkompliziertesten umwandeln ?</p>
<p>Bsp : m_GesamtString = m_String1 + m_String2 + &quot;\t&quot; + m_Floatwert;</p>
<p>So geht es ja nicht, klar, aber wie dann ?</p>
<p>Vielen Dank !</p>
<p>mfg<br />
Alex</p>
]]></description><link>https://www.c-plusplus.net/forum/post/423285</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/423285</guid><dc:creator><![CDATA[Alex_Gast]]></dc:creator><pubDate>Fri, 26 Dec 2003 09:02:02 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandlung und Kommastellenproblem on Fri, 26 Dec 2003 09:23:00 GMT]]></title><description><![CDATA[<p>CString::Format ist die Lösung:</p>
<pre><code class="language-cpp">CString str;
float a = 1.2;

str.Format(&quot;%.2f&quot;,a);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/423288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/423288</guid><dc:creator><![CDATA[Shlo]]></dc:creator><pubDate>Fri, 26 Dec 2003 09:23:00 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandlung und Kommastellenproblem on Fri, 26 Dec 2003 11:09:02 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Danke, hat bereits wunderbar funktioniert. Wie kann ich aus bei einer Berechnung von zwei double-Werte dafür sorgen, dass bei 10 + 10 auch 10.00 und nicht nur 10 angezeigt wird ?</p>
<p>strErg = strWert1 + strWert2;</p>
<p>Ich will dass es auf zwei Nachkommastellen angezeigt wird, sind nur reine double-Werte.</p>
<p>Danke !</p>
]]></description><link>https://www.c-plusplus.net/forum/post/423320</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/423320</guid><dc:creator><![CDATA[Alex_Gast]]></dc:creator><pubDate>Fri, 26 Dec 2003 11:09:02 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandlung und Kommastellenproblem on Fri, 26 Dec 2003 11:25:14 GMT]]></title><description><![CDATA[<p>?<br />
10 + 10 als strings ergibt 1010 ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/423331</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/423331</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Fri, 26 Dec 2003 11:25:14 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandlung und Kommastellenproblem on Fri, 26 Dec 2003 12:05:18 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Nein sollten float-Werte sein, war mein Fehler, also fZahl1 + fZahl2.<br />
Wenn beide Zahlen 10 sind, bekomme ich 20 raus, will aber 20.00, zwei Nachkommastellen, selbst wenn diese Null sind angezeigt haben.</p>
<p>Wie ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/423356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/423356</guid><dc:creator><![CDATA[Gast_Alex]]></dc:creator><pubDate>Fri, 26 Dec 2003 12:05:18 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandlung und Kommastellenproblem on Fri, 26 Dec 2003 14:55:30 GMT]]></title><description><![CDATA[<p>Hä? Genau so wie oben ?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/423475</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/423475</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Fri, 26 Dec 2003 14:55:30 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandlung und Kommastellenproblem on Fri, 26 Dec 2003 16:19:18 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Kannst bitte ein Bespiel machen, ich will ja keine String draus machen sondern einfach nur zwei float-Werte addieren und in einen float speichern, aber es sollen zwei Nachkommastellen gewährleistet werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/423518</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/423518</guid><dc:creator><![CDATA[Gast_Alex]]></dc:creator><pubDate>Fri, 26 Dec 2003 16:19:18 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandlung und Kommastellenproblem on Sat, 27 Dec 2003 20:05:20 GMT]]></title><description><![CDATA[<p>ein floatwert ist ein floatWERT! wenn es genau 7.0000000 ist, ist es eben 7.<br />
Die Nachkommastellen siehst du erst, wenn du es in nen String umwandelst, anders kannst du eh keine zahlen anzeigen lassen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/424125</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/424125</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Sat, 27 Dec 2003 20:05:20 GMT</pubDate></item></channel></rss>